3

I have a file with 020 privileges on the file, and I can't delete it or perform a chmod on the file. Do you know what the minimum privileges the owner needs on a file to still do a chmod on a file?

  • The permissions on the directory are 755
  • This is an AIX OS
  • 3
    File permissions aren't the problem - it's permissions to the directory the file is in. Check that directory's perms to see what's going on. – Michael Kohne May 6 '15 at 12:57
  • On the directory they are 755. – Off The Gold May 6 '15 at 13:08
  • Woops, my mistake, I was logged on with the non-owner account. No problem when logged in as owner – Off The Gold May 6 '15 at 13:29
5

The file mode has no effect on whether or not the owner can chmod a file.

$ chmod 000 foo
$ ls -l foo
---------- 1 chris chris 0 May  6 13:55 foo
$ chmod 700 foo
$ ls -l foo
-rwx------ 1 chris chris 0 May  6 13:55 foo

You probably have bad permissions on the parent directory -- at the very least, your user needs the execute permission set on the directory to change the mode of files inside.

You can find more information about how directory permissions work at "Why do directories need the executable (X) permission to be opened?".

  • The owner only needs access (execute) permission on the directory. You need read permission to be able to scan the directory (to read the names in the directory), but if you know the name, execute is sufficient. – Jonathan Leffler May 6 '15 at 13:08

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.