Permissions in Octal - Basic
How many of you all have ever had trouble getting certain files,
directories, or even programs to run even if you are root? I'm sure most
of you. Permissions work in the unix environment alot different than in
the simple windows one. Although in UNIX it is still fairly simple, it
takes a bit of knowing to do it. So here goes:
________________________________________________________________________
READ Write Execute
____ _____ _______
4 2 1
________________________________________________________________________
ok, the table above gives you the octal values of permissions. 4 = Read, 2
= Write, 1= Execute. 0 means there is no permission. So you can have
something like this:
[perm@localhost perm]$ chmod 777 /i/am/permissizing
will make the file rwxrwxrwx
r = read
w = write
x = executable
The way you get these numbers is simple addition. chmod 777 is full
permissions, and you should be careful about whom you assign that to in
your network. bash: cd: root: Permission denied
never chmod root as root :)
so remember for octal permissions all you have to do is add the numbers
together, (e.g. 4+2+1=7) (2+1=3) <- execute and write (4+1=5 Read and
execute) (4+2+1 = 7 Read Write Exectute, the whole deal ) o yeah and
(4+2=6 Read and Write only)
bash-2.05a$ ls -la
total 188
drwxr-xr-x 22 root root 4096 Dec 23 00:01 .
drwxr-xr-x 22 root root 4096 Dec 23 00:01 ..
-rw-r--r-- 1 root root 0 Dec 10 12:59 .autofsck
drwxr-xr-x 2 root root 4096 Feb 22 2002 .automount
drwxr-xr-x 2 root root 4096 Nov 2 02:11 bin
drwxr-xr-x 3 root root 4096 Nov 2 02:03 boot
drwxr-xr-x 18 root root 86016 Dec 10 13:03 dev
drwxr-xr-x 84 root root 8192 Dec 22 23:46
drwxr-xr-x 5 root root 4096 Dec 20 07:41
drwxr-xr-x 2 root root 4096 Jun 21 2001
drwxr-xr-x 9 root root 4096 Nov 2 02:07
drwx------ 2 root root 16384 Nov 2 01:31
drwxr-xr-x 2 root root 4096 Apr 2 2002
drwxr-xr-x 3 root root 4096 Nov 3 21:03
drwxr-xr-x 2 root root 4096 Dec 23 00:01
drwxr-xr-x 2 root root 4096 Aug 23 1999
dr-xr-xr-x 143 root root 0 Dec 10 06:58
drwxr-x--- 30 root root 4096 Dec 23 00:01
drwxr-xr-x 2 root root 8192 Nov 2 21:44
drwxr-xr-x 3 root root 4096 Nov 2 02:06
drwxrwxrwt 22 root root 4096 Dec 23 11:58
drwxr-xr-x 19 root root 4096 Nov 23 09:21
drwxr-xr-x 29 root root 4096 Dec 19 15:30
Permissions # usr total Date
________________________________________________________________
anyway, just remember that giving the permission 777 to people is
generally a bad idea, 775 is about the highest you should go.
for more tutorials check - www.bytekill.com