Showing posts with label To change directory permissions in Linux. Show all posts
Showing posts with label To change directory permissions in Linux. Show all posts

User management commands in linux

linux commands for begginers

How to add / change permissions to user in linux?

In this article beginners will learn, how to add / change the permissions in linux. This article explains the commands in linux to set permissions. Use the following commands to add / change the permissions in linux.

chown command
chown command is used to change the permission of owner and group of a file or directory.
chown user:group [file/directory]

chmod command
chmod command is used to give permissions to folder in linux, chmod command that change the permission of the user owner, group and other users for a specific file/directory.
we can give the permission as digits.(4 = read permission , 2 = write permission , 1 = execute permision)
chmod 760 [file/directory]

This command means that
  1. The owner of the file/directory have all read,write and execute permission .
  2. users in the group will get read, write and execute permissions.
  3. other users will not have any permission to that file/directory.
ACL linux permission (Access control list)
ACL linux permissions are used to set permissions to a specific user for a specific file/directory.
Using chmod command it is difficult to set different permissions to different users when there is a situation where lot of users in that case we use acl commands.

Linux setfacl example :
setfacl –m u:Testuser:rwx [file/directory]

This command gives read ,write,and execute permissions to our user.
To allow all file/directory to inherit ACL permission from the directory it is within,we can use –d option.
setfacl –dm u:Testuser:rwx [file/directory]

getfacl command can be used to view the permissions of file/directory.
getfacl file/directory

Author : 
Ajith Michael
System Engineer
Bayasys Infotech (P) Ltd., Kochi.

Image source : www.google.com