Score:0

Unabel to read/write file even with correct permisisons. Can create and delete file

ye flag
TTa

Running into a strange issue - I have 700 file permissions on the current directory, and I am able to create and remove files (which get created with 600), however whenever I try to read or edit the file I get a permissions denied/read only. When I change the file specifically to 604, I am able to read and write the file. I've confirmed that the full path to the directory has proper permissions as well.

Example below:

mike@desktop:~/testdir$ ls -alh
total 8.0K
drwx------  2 mike domain users 4.0K Dec 22 12:20 .
drwx------ 19 mike domain users 4.0K Dec 22 12:20 ..
mike@desktop:~/testdir$ touch test.txt
mike@desktop:~/testdir$ cat test.txt
cat: test.txt: Operation not permitted
mike@desktop:~/testdir$ ls -alh
total 8.0K
drwx------  2 mike domain users 4.0K Dec 22 12:21 .
drwx------ 19 mike domain users 4.0K Dec 22 12:20 ..
-rw-------  1 mike domain users    0 Dec 22 12:21 test.txt
mike@desktop:~/testdir$ vim test.txt (got read only error message when saving)
mike@desktop:~/testdir$ ls -alh
total 8.0K
drwx------  2 mike domain users 4.0K Dec 22 12:21 .
drwx------ 19 mike domain users 4.0K Dec 22 12:21 ..
-rw-------  1 mike domain users    0 Dec 22 12:21 test.txt
mike@desktop:~/testdir$ chmod 604 test.txt
mike@desktop:~/testdir$ vim test.txt
mike@desktop:~/testdir$ ls -alh
total 8.0K
drwx------  2 mike domain users 4.0K Dec 22 12:21 .
drwx------ 19 mike domain users 4.0K Dec 22 12:21 ..
-rw-------  1 mike domain users    0 Dec 22 12:21 4913
-rw----r--  1 mike domain users    6 Dec 22 12:21 test.txt
-rw-------  1 mike domain users    0 Dec 22 12:21 .test.txt.swo
-rw-------  1 mike domain users    0 Dec 22 12:21 .test.txt.swp
mike@desktop:~/testdir$ cat test.txt
Hello

I can also mv and rm the file when it has 600 permissions.

waltinator avatar
it flag
Explore your Mount/Read/Write/Execute problems with `https://github.com/waltinator/pathlld`, a `bash` script to show the permissions, mount options along the path to an object or objects.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.