A quick explanation of permissions in linux using the chmod command.

I have had many people enquire what chmod 664 or chmod 750 means and it is really quite simple. The command will allow you to set the permissions for the owner/group/others of a file or folder.
The numbers 1-7 are made up of 4-2-1 and 0.

0=none
1=execute
2=write
4=read
5=read/execute
6=read/write
7=read/write/execute

If for instance you run ls -al to see what permissions a file/folder has in terminal you dont see 750 you will instead see something similiar to:
drwxr-xr-x 2 ben ben 4096 Mar 26 19:46 Desktop

Looking at that we can see that its a directory because of the ‘d’ in drwxr-xr-x and that the owner (ben) has rwx (read/write/execute), the group (ben) has r-x (read/execute) and others have r-x (read/execute). Which relates to 755.

If we only want the owner (ben) to have access we can of course use chmod 700 Desktop

Advertisements
Tagged with:
Posted in 01Ben, Linux
One comment on “A quick explanation of permissions in linux using the chmod command.
  1. […] not allow access to the right users/group , I have written before about linux permissions here. To allowing everyone access i would use 666 that would allow the owner/group/others read/write […]

Please feel free to leave a reply.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 68 other followers

%d bloggers like this: