file permission in linux
TRANSCRIPT
Basic File Permissions
Basic File Permissions
File and Directory Attributes
-Unix/Linux files have 8 attributes that can be seen with ls –l command.
-rw-r—r-- 1 root root 1229 Aug 20 6:20 reports
si
Note: only the owner or the root can change the permissions.
root@powerpc# ls –l reports
Type
permissions
links owner
Owner’s primary group
Date File names Size
Access Levels
- rwx rwx rwx
- Filed Directoryl links
Owner Primary Group Others
Access Modes
Permission
Absolute Mode4 2 1
Symbolic Moderwx
Access Modes
Access Mode File Directory
r 4 To display the content of the file To list the contents of the directory
w 2 To modify or append to the file To create or remove files of directories
x 1 To execute the file To enter into the directory
Default Permission
File Directory
Created by root
rw-r—r-- 644 rwxr-xr-x 755
Created by user
rw-rw-r-- 664 rwxrwxr-x 775
Modifying the Permission
Modifying the Permission[root@power_pc]# chmod <permission/weight> <file/dir>
Options:
Category u(owner) g(group) o(others)
Operators + - =
Permissions r w x
Weight 4 2 1
Example of Permission: Absolute
Applying permission to owner(u), group(g) and others(o) on file reports[root@power_pc]# chmod 754 reports
Example of Permission: symbolic
Applying permission to owner(u), group(g) and others(o) on file reports[root@power_pc]# chmod u=rwx, g=rx o=r reports
Changing Ownership
Changing ownership of a file or directory [root@power_pc]# chown <user name/group name> <file/dir name>