Is it possible for a user to have a write access to a file and not be able to read it? How is it possible?

I tried the following commands:

debianbox@debian:~/posix/io$ touch filetest
debianbox@debian:~/posix/io$ ls -l filetest
-rw-r--r-- 1 debianbox debianbox 0 14 oct.  03:10 filetest

debianbox@debian:~/posix/io$ echo "Hello World" > filetest
debianbox@debian:~/posix/io$ cat filetest
Hello World

debianbox@debian:~/posix/io$ chmod u-r filetest
debianbox@debian:~/posix/io$ cat filetest
cat: filetest: Permission forbidden


As you can see here, I have write but not read access on this file. How can this be possible? Is this considered as a bug? If not, in what situation would this be useful?

3 Answers 3


The main reason to allow write access without read access is that it simplifies the management of permissions, both inside the kernel and in user programs. There are two permissions, one for reading and one for writing, and they are managed independently. This is not a bug since the documented behavior coincides with the actual behavior and there is no good reason to require a different behavior.

Having write permissions without read permissions doesn't make much sense for regular files. It does make sense for various special files.

  • Some systems allow append-only files. This is useful for log files, for example. It can make sense to allow many users to create log entries, but not to allow them to erase or overwrite existing entries (hence: write permission, but append-only attribute), nor to allow them to read others' entries (hence: no read permission).
  • A program may be allowed to write to a named pipe without being allowed to read from it.
  • Some devices are write-only. For example, a sound output device connected to a loudspeaker but no microphone should have write permission but no read permission.
  • There are various special filesystems where reading or writing to a file has an immediate effect instead of retrieving or adding data to storage. For example, under Linux, there are various files under /proc and /sys that allow user space programs to send commands to the kernel by writing to a particular file. If that command doesn't provide any feedback, the special file is made write-only.

It is not a bug, it's a featureTM (Also, just a consequence of universal unix approach to permisions).

Apart from dropbox-like behavior in case of directories (as described by BillThor), write-only access is necessary for some special (pseudo-) files under /proc and /sys. Such files are used to set some driver or kernel properties or trigger a system action. You cannot read them, because they are used only for one-way signaling - you can only echo some text/data to them. To find such files, you can use

find /proc/[^0-9]* /sys -perm /222 ! -perm /444

Notice that, since these files are used for advanced system configuration (potentially dangerous), only root has write access to them (in most cases).


No this is not a bug. However, I don't see it commonly applied to files.

I have most often seen write only access on dropbox directories. Users can add files to the directory, but can't see which files are exist.

For a regular text file write only access would be appropriate for dropbox type access.

Setting write only access for yourself would not be terribly useful, but not allowing it would complicate permissions code.

EDIT: Dropbox files are not likely to be useful. However, it might be useful for non-root logs as it would make it more difficult to overwrite log entries. If you can read the file, it is much easier to identify where to write a replacement log entry. However, I don't know anyone who sets their logs up like this. It is common to use remote logging to prevent local modification of log entries.

Setting rules on which permission combinations are permissible, could lead to preventing unforeseen useful permissions. Many combinations make more sense on the group or world level than the owner level. Any attempts to prevent access by the owner can be easily overridden. However, they can be useful to force sober second though.

  • A "dropbox file" would actually have little sense. It could be only used to write some data and even if it was made readable at some point, its contents would show no real trace of what was happening to it, because it could have been previously erased or removed. Oct 14, 2011 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.