LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-11-2011, 10:43 PM   #1
polpak
Member
 
Registered: Jan 2011
Location: Planet Earth, Australia, NSW
Distribution: GNOME openSUSE Leap/Ubuntu
Posts: 189

Rep: Reputation: 21
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 ?




.
 
Old 12-11-2011, 10:45 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
http://linux.die.net/man/1/chmod
http://en.wikipedia.org/wiki/Chmod
 
0 members found this post helpful.
Old 12-12-2011, 12:13 AM   #3
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
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.

Last edited by Telengard; 12-12-2011 at 12:15 AM.
 
1 members found this post helpful.
Old 12-12-2011, 12:31 AM   #4
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
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.
 
0 members found this post helpful.
Old 12-12-2011, 06:29 PM   #5
polpak
Member
 
Registered: Jan 2011
Location: Planet Earth, Australia, NSW
Distribution: GNOME openSUSE Leap/Ubuntu
Posts: 189

Original Poster
Rep: Reputation: 21
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
 
Old 12-12-2011, 09:25 PM   #6
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
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 View Post
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

Last edited by Telengard; 12-12-2011 at 09:34 PM. Reason: permission flags
 
1 members found this post helpful.
  


Reply

Tags
chmod, permission



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find the total of numbers that are higher than x in a text file with numbers (using awk??) Mike_V Programming 12 11-24-2010 09:51 AM
chmod octal numbers fakie_flip Linux - Software 8 03-31-2010 11:00 AM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM
chmod 775 to only the directories and chmod 664 to only the files? apachenew Linux - Security 6 09-27-2007 03:26 PM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 04:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration