How To Changing Access permissions in FreeBSD How To Changing Access permissions in FreeBSD |Variety of Information and Business

Wednesday, November 23, 2011

How To Changing Access permissions in FreeBSD

Permits access to the file or a directory can be changed with the command chmod, which form the command as follows:
chmod mode filename [ WHO ] operating permit
Function: changing permissions
Description:
Change the mode ( file protection bits) of a file. File mode is the arrangement of bits
the contents of the file directory that determine who gets the permission to read,


  • The file name
  • Date of creation & hours
  • File Size
  • The group name 
  • Name of user 
  • Mode of File 
  • Indicator 
  • Directory
Access permissions for the file owner ( read, write, execute )
Permits access, for users who are included in the
one group with the file owner (read & execution)
Other users can only execute a program, but can not read and modify

writing, working on the file. Only the file owner or super user may change mode.
1. Uses octal numbers to set the mode.
2. Uses  the symbol to determine the new mode.

Arguments: Reading, writing and craftsmanship want the bits specified file in octal form. Octal number consisting of 4 digits. most significant digits contains bits to control the workmanship, the following digits have bits, bits permit owner, the next digit groups have permission bits and least significant digit
bits contain the general permit.

Octal number is obtained by logic 0E with the following bits:

4000 to determine the owner ID on execution
2000 to determine the group ID on execution
1000 left the program in memory
0400 permits reading ( Read ) to the user
0200 permits writing ( Write) to the user
0100 permissions ( Execute ) for
0040 permits reading ( Read ) for members of group
0020 write permission for group members
0010 permissions for group members
0004 read permission for
0002 write permission for others
0001 permissions for others
WHO determines to whom permission is granted

   combination of three letters, " o ", " g " and "u " or a single letter "a".

Default of WHO is " a".
a ( all) all
g ( group ) group
u ( user) user
+ add license
- Remove the permit
r read permission
w write
x read
s set the ID owner / group
t do not exchange

Examples of changing the file mode

$ Ls -l try
- rw -r -r -1 Admin November 26 13:17 206 users try ( initial conditions )
$ Chmod 777 try (change file modes )
$ Ls -l try
- rwxrwxrwx 1 Admin November 26 13:17 206 users try * ( mode set to 777)
..
. $ 700 try chmod (change mode again )
$ Ls -l try
- rwx - 1
Admin November 26 13:17 206 users try * ( mode set to 700)
$ Chmod 751 try (change file modes )
$ Ls -l try
- rwxr - x - x 1 206 users
Admin November 26 13:17 try * ( mode set to 751)
$ Chmod 000 try (change file modes )
$ Ls -l try

- - - 1 206 users Admin November 26 13:17 try * ( mode set to 000)
$ Chmod a x try (change file modes )
$ Ls -l try
- X - x - x 1 206 users
Admin November 26 13:17 try * ( mode set to 751)
$ Chmod u rwx try (change file modes )
$ Ls -l try
- rwxr - x - x 1 206 users
Adm November 26 13:17 try * (user +r, +w, +x )

Relate Post

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites