LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chmod numbers and uses ? (https://www.linuxquestions.org/questions/linux-newbie-8/chmod-numbers-and-uses-918260/)

polpak 12-11-2011 10:43 PM

chmod numbers and uses ?
 
Any easy find page about chmod with any regularly used numbers and what they are used for ?


Do these chmod usages vary between distributions ?




.

corp769 12-11-2011 10:45 PM

http://linux.die.net/man/1/chmod
http://en.wikipedia.org/wiki/Chmod

Telengard 12-12-2011 12:13 AM

The numbers are octal and they represent Unix permissions.

Code:

$ ls -ln
total 16
-rwxr--r-- 1 1000 1000  763 2011-12-10 03:00 dff.awk
drwxr-xr-x 2 1000 1000 4096 2011-12-10 01:56 dir1
drwxr-xr-x 2 1000 1000 4096 2011-12-10 01:57 dir2
drwxr-xr-x 2 1000 1000 4096 2011-12-10 01:57 dir3
-rw-r--r-- 1 1000 1000    0 2011-12-10 01:57 file0
-rw-r--r-- 1 1000 1000    0 2011-12-10 01:56 frog

  • All these files belong to the user with uid=1000, and the group with gid=1000.
  • frog has read/write permission for user 1000, and read-only permission for everyone else.
  • dff.awk has read/write/execute permission for user 1000, and read-only permission for everyone else.

Permissions are three bits wide, thus the use of octal numbers. When you see chmod 644, that's an octal number. Each digit is three bits.
  • 6 = owner = 110 binary = rw-
  • 4 = group = 100 binary = r--
  • 4 = other = 100 binary = r--

You can set the same permissions with symbolic flags, such as chmod 'u=rw,g=r,o=r'. There are many tricks to getting the exact permissions you want on any particular file. Just read the manual and give some consideration when setting permissions.

chmod invocation - GNU Coreutils.

devUnix 12-12-2011 12:31 AM

Hi! Welcome to LQ!


Please be advised that you should do some "research" or "work" on your own as the LQ Forum is meant for discussing problems.

Go to tldp.org and download/view the Linux Introduction Guide.

polpak 12-12-2011 06:29 PM

Appreciated the help, do accept my post was not clear :-(

Some friction drew to my attention - and quickly my concern, that our settings made users homes and contents available for all to read.

Created user joe and tested default settings were 755

Calm after changed them to 700, yet wonder what other problems this may cause ?


:~> stat -c '%A %a %u' /home/*
drwxrwxrwx 777 0
drwxr-xr-x 755 1000
drwx------ 700 0
drwx------ 700 1003
drwx------ 700 1001
drwx------ 700 1002




Are there standard settings for users in /home/(USERNAME) or do they vary between Distributions.



Am looking further into how can enable the /home/username/Public to be open, without opening everything else.



on openSUSE 11.4 x86-64

Telengard 12-12-2011 09:25 PM

Please don't take anything I write below literally. I don't administer any any multi-user systems. I just have some thoughts for you until someone else jumps in with some better information. You shouldn't take my advice without doing a bunch of research and experimentation on your own first. (I think that's why the others were trying to help by pointing you to the manpage.)

Quote:

Originally Posted by polpak (Post 4548320)
Calm after changed them to 700, yet wonder what other problems this may cause ?

I don't really know of any problem it would cause. Maybe someone else could add more about that. Just understand that programs inherit permissions of the users who invoke them, although I think there are some special bits which can get around that.

Quote:

Are there standard settings for users in /home/(USERNAME) or do they vary between Distributions.
I think they vary by distro, but I haven't spent much time on any distros outside Ubuntu recently. In any case you are free to administer and experiment with your system however you like.

Quote:

Am looking further into how can enable the /home/username/Public to be open, without opening everything else. on openSUSE 11.4 x86-64
I don't know anything about openSUSE or your system, but here's a guess: First make symlinks to /home/username/Public/ within the home folders of users you want to access it. Then:

Code:

chmod -R 'a+rw' /home/username/Public/
If that isn't good for you, then maybe create a new group, for example pubusers. Then add all users you wish to grant access to that group. Then:

Code:

chown -R 'username:pubusers' /home/username/Public/
Again, please don't do any of those things above until you do your own research and experiments. Prove it to yourself, then you know.

http://en.opensuse.org/SDB:Official_documentation


All times are GMT -5. The time now is 10:03 AM.