Solved

chmod explain

Posted on 2002-07-04
4
778 Views
Last Modified: 2013-12-27
Hi...i don't really understand how this work.

 i've seen command like ;

  chmod 777 file1
  chmod 666 file1

 i know that the command will
 set certain permission on the file1.
how to use the numbers (654,666,777, etc)?

 tq.

 Sun newbie.
0
Comment
Question by:ismahwati
  • 3
4 Comments
 

Author Comment

by:ismahwati
ID: 7130543
i also have seen command ;

 $ stty erase

 what it do actually.

 tq

0
 
LVL 3

Accepted Solution

by:
UkWizard earned 20 total points
ID: 7130609
Right, firstly chmod;

chmod changes the permissions as you said, it works out to numbers by numbers representing the r ( read ) w ( write ) and x (execute ).
For example; if "ls -al" displays the following;

-rwxr-xrw-  owner  group  size date filename

ignore the first -, this means its a file.
break it down into pairs of three ( rwx ) ie;

rwx r-x rw-  

Where the first block is the file owners permissions.
second is the groups permissions
third is the 'other' permissions

So, The owner ( whatever owner is set to ) has read,write and execute permissions.

Anyone who is in the group ( what the group is set too) has read and execute permissions.

Any other person has read and write permissions.


So, now the numbers thing, each r, w and x represent a number. where r =4, w=2 and x=1.
Now you simpy add the numbers together of the permissions that you require.
So the command "chmod 756 filename" would give the permissions as above ( rwx r-x rw- ) because;

rwx = 4+2+1 = 7   ( owner permissions )
r-x = 4+1   = 5   ( group permissions )
rw- = 4+2   = 6   ( other permissions )

Hope thats clear now, now the 'stty' command

Stty sets/displays the current terminals line settings;

stty erase - sets the erase charactor, see "man stty" for more info.

Enjoy,

UkWizard.

0
 

Author Comment

by:ismahwati
ID: 7136746
tq..that helps
0
 

Author Comment

by:ismahwati
ID: 7136842
sorry ..i forgot to accept the anhwer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now