Types of Permissions in Linux
r
: readw
: writex
: execute
Permissions (rwx) levels
u
: current userg
: group in which user belongs too
: othersa
: all
How to chagne permissions?
To change the permissions in the file or directory we use the chmod
command.
1
2
3
4
5
6
7
8
Syntax:
chmod u+r <file_name> (For adding reading permission to the current user)
chmid u-r <file_name> (For removing reading permission from the current user)
chmod ugo+r <file_name> (For adding reading permisison to the current_user, group and others)
chmod ugo+r <file_name> (For removing reading permisison from the current_user, group and others)
chmod a+rwx <file_name> (adding permission for all)
Syntax:
Note: One user cannot change the permission of the files and directories of another user unless it’s theroot
user.
Chmod Numeric Mode
Syntax:
1
2
3
4
5
chmod 756 <file_name>
where,
7 = user,
5 = group
6 = other user