Thursday 8 March 2007

Changing File Permissions in terminal using Chmod

Ah the joys of trying to copy a file to ROOT or any other folder in the root directory. Most cases your going to get stumped by a message saying no you need permissions to copy the file.
You permission setup is slighty strange if you are a new Linux user as the file permissions go in a number format for you to set.
The format which it is set in is a 3 figure format for example 777.
The first '7' tells chmod that the file's owner is allowed to read, write, and execute the files specified by the path argument. The second '7' is for the Group permissions, in this case 'group' is the group that the OWNER of the of the files belongs to. The third '7' is for everyone else.

OWNERGROUPOTHERS
Read: 4 Read: 4 Read: 4
Write: 2 Write: 2 Write: 2
Execute: 1 Execute: 1 Execute: 1




Using Chmod to set permissions

To set permissions on a folder simply type:
code
su root
[rootpass]
chmod 777 /mnt/usb