Click to See Complete Forum and Search --> : Whats the Command for....


Dreak
08-24-2001, 04:13 PM
When I try to open certain things I get the "Permision denied". Even in root I get that. I forgot, what are the commands to change that (and an example if you can, newbie here)? :confused:

PimpHolic
08-24-2001, 04:21 PM
chmod <permissions> <file>

Malakin
08-25-2001, 04:22 AM
Someone else wrote the part I'm quoting, it was a good description so I saved it but I can't remember who it was otherwise I'd give them credit :)

quick permissions lesson :)

0 = ---
1 = --x
2 = -w-
4 = r--

add them together for a number between 0-7 (octal)

ex 7 = rwx
6 = rw-

when chmod'ing

chmod wxyz file

w= special permission (suid, sgid and sticky bit)
x= owner permissions
y= group permissions
z= world permissions

if w is not there it is assumed to be 0, all others are required.

So, to make a files executable by you, the minimal permissions are 500 (r-x------)


To change the owner it's "chown username filename" replace filename with a directory and use a -R to do it recursively.

To change the group it's "chgrp groupname filname" also works with -R.

Also on ext2 filesytems and I assume ext3 chattr can also be used. "man chattr" for more info but you can do things like make a file immutable with "chattr +i filename".