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
Off The Gold
  • 195
  • 2
  • 8

1 Answers1

6

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?".

Chris Down
  • 125,559
  • 25
  • 270
  • 266
  • 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 06 '15 at 13:08