Interpreting chmod command
2 Attachment(s)
we have 3 types of permissions r w x
and 3 entities we can give these permissions to u, g, o [username as root] ~ $ ls -l .ICEauthority -rw------- 1 [username] [username] 2590 Sep 7 01:43 .ICEauthority in other words, I, as root, have rw on .ICEauthority "-rw-rw-r--. 1 bob bob 0 Mar 16 19:04 file-1" This line means u has read/write g has read/write but o has only read. IN this command: chmod uo+x, g-w user and others are being given execution permission the group to which user and group belong is being deprived of write permission In the line [test3@centOS -] $ chmod uo+x, g-w test1 This means test3 as root is changing permissions for user test1 test3 gives test1 and others execution permission but for the group test1 belongs to test3 removes write permission Is this the correct interpretation of this command, please? in the screenshot is the line drwxr-xr-x this is brought up by ls -l, so is not a command but a report. what does the d in front of rwxr mean? what does this statement mean, please? |
Interpreting chmod command
d like directory
|
Quote:
The chmod and chown commands change permissions for files and/or directories. In the case of directories, you can do it recursively to include all files in a directory but that isn't usually a good idea unless it is some user created directory. You asked "what does this statement mean, please?" What statement are you referring to? |
Quote:
Quote:
When you use chmod and give a file +x so that it can be executed, that is different to when you +x for directories. Directories cannot be executed as if they are executables since they are just folders that hold other files. So if you give +x to a directory, it means that you are granting access to that directory for the user, group, other or combinations of those. In the pic, for example, there is a Music directory which has +x for others. This means that others (anyone) can access that directory, and not that they can execute the directory, because that makes no sense. So, x means 2 different things, one for files and one for directories. chown changes ownership of files and directories, not permissions. In the pic files are owned by root and test1. chown can change these owners to other owners on the system. |
Quote:
drwxr-xr-x So d in front means directory someone already has this set of permissions I assume over this directory. the user has "drwx-..." the group has execute and read "...xr..." others have execute "...x" Is that correct reading of the line? I think I am getting this wrong because in the second series x comes before r which does make sense to me yet. also, in the first set, drwxr..., why is there an r at the end (unless the final r relates to the x after the hyphen)? In other words x-r means a particular action: "drwxr-x..." |
Quote:
The user test3@CentOS inputs ls -l to find out about file test1 The answer is, going I think by what you imply, that user test2@CentOS has rw, the group he belongs to has rw others have r then test3@CentOS wants to change permissions so he types chmod uo+x (meaning he wants himself and other to have execute permission over file test1)? If the user test3@CentOS is not root then the answer will be permission denied unless he has special permissions given him by root. Apparently he has because he types ls -l again and permission for file test1 have changed: -rwxr--r-x now user has rwx (I don't know what the final r means) group has r other has x Is this the correct reading? |
Quote:
drwxr-xr-x d means directory rwx means the user "u" has read, write, execute permissions r-x means the group "g" has read and execute permissions r-x means others "o" have read and execute permissions. Quote:
There are 10 columns. The first one tells you if it's a directory, file or link. The next three are the user's permissions, the next three are the group permissions, the last three are the "other" permissions. |
Quote:
When you run "chmod g+w file", you're allowing any members of the same group as the file write permission to it. It makes no difference who you are when you run that command, except of course that you will need permission to change the file's permissions, otherwise you'll get a permission denied error. |
Quote:
https://www.linux.com/learn/tutorial...le-permissions |
Quote:
As root, those permissions do not apply to you. user.group has those permissions/restrictions, not root. |
|
[QUOTE=hortageno;5417657]No, there are three groups of permissions with 3 characters each. Each of these groups has one set of rwx (read, write, execute) in this order. If one character is replaced by a minus, then it means "not". This link probably explains it better than I do ;)
What would these 2 phrases mean g+x g-x ? |
Quote:
|
All times are GMT -5. The time now is 09:05 AM. |