PDA

View Full Version : [ubuntu] chmod - mode of 'file.name' retained as 0755



aidanewen
October 11th, 2010, 03:48 PM
OK, this is making me crazy. I can't seem to chmod a directory.



user@host:/usr/share$ sudo chmod -Rv o+r openbravo-erp
mode of 'openbravo-erp' retained as 0755 (rwxr-xr-x)
user@host:/usr/share$
I've tried ls -L to see if it's a symbolic link but it doesn't seem to be. I've no idea why I can't change the permissions.

Can anyone help?

mike2357
October 11th, 2010, 03:55 PM
It looks like it's working, but chmod is telling you the permissions you want are already set, so there's no need to change.

"o+r" means give others read permission, and it appears they already have it.

What are you trying to do? Maybe there's a piece I'm not seeing.

aidanewen
October 11th, 2010, 04:02 PM
Sorry I made a typo above, the permissions on the directory are drwxr-xr-x.

(I've now corrected my original post...)

bodhi.zazen
October 11th, 2010, 04:43 PM
Sorry I made a typo above, the permissions on the directory are drwxr-xr-x.

(I've now corrected my original post...)

What do you want the permissions to be ?

Since others already have r access, +r will do nothing.

You need to either

chmod 750 (use numbers) or remove permissions you do not want

chmod o-x

BUT permissions on directories are not the same as permissions on files

http://www.zzee.com/solutions/linux-permissions.shtml

aidanewen
October 11th, 2010, 04:47 PM
I want others to have read permission:

drwxr-xr-xr rather than drwxr-xr-x

aidanewen
October 11th, 2010, 04:50 PM
I'm trying to apply the change to all files and sub directories recursively (using the -R option).

The Cog
October 11th, 2010, 05:00 PM
I want others to have read permission:

drwxr-xr-xr rather than drwxr-xr-x

drwxr-xr-x does give everyone read permissions. It's a directory and the user permissions are:
rwx : full permissions to owner
r-x : read and execute (enter the directory) to the group
r-x : read and execute (enter the directory) to the world

There cannot be another "r" after drwxr-xr-x because the description is already complete.

aidanewen
October 11th, 2010, 05:22 PM
OK, I get it. Only files can have that r - not directories (where an x means they can be opened right?).

What about my recursive change of permissions. I want all the files in the directory readable by anyone, but I'm getting the following:



user@host:/usr/share$ sudo chmod -Rv o+r openbravo-erp/


.....


mode of `openbravo-erp/src/src/index.html' retained as 0755 (rwxr-xr-x)
mode of `openbravo-erp/src/src/build.xml' retained as 0755 (rwxr-xr-x)
mode of `openbravo-erp/src/src/ehcache.xml' retained as 0755 (rwxr-xr-x)
mode of `openbravo-erp/src/src/buildAD.xml' retained as 0755 (rwxr-xr-x)
user@host:/usr/share$

It doesn't look like I've managed to change the permissions on my files either.

The Cog
October 11th, 2010, 05:37 PM
But others already have read permissions. Look:

mode of `openbravo-erp/src/src/index.html' retained as 0755 (rwxr-xr-x)
Other users permissions are already r-x (read, not write, execute). That's why the existing mode was retained. I don't think you really want executable XML files, but that's another issue.

aidanewen
October 11th, 2010, 05:57 PM
OK, I think I'm starting to understand this properly - The hyphens don't separate users, groups and others, they represent missing permissions?

So if I did a chmod o-r on one of those xml files I'd get rwxr-x--x?

I think I get it.

Thanks loads for your help.

mike2357
October 11th, 2010, 06:16 PM
When you're ready to digest more, check this out:

https://help.ubuntu.com/community/FilePermissions

The Cog
October 11th, 2010, 07:26 PM
OK, I think I'm starting to understand this properly - The hyphens don't separate users, groups and others, they represent missing permissions?

So if I did a chmod o-r on one of those xml files I'd get rwxr-x--x?

I think I get it.

Thanks loads for your help.

Absolutely - you got it.

If your users still get access denied when read the files, check every directory in the path down to to files, looking for a directory they don't have permissions to. I think they need both r and x on the directories.

sisco311
October 11th, 2010, 07:46 PM
I think they need both r and x on the directories.

They need read and execute (a.k.a. search) permissions on the directory and execute permission on every ancestor directory.

Unix/Linux file & directory permissions are well explained here: http://content.hccfl.edu/pollock/aunix1/filepermissions.htm