16
LINUX FILE PERMISSIONS

Filepermissions in linux

Embed Size (px)

Citation preview

Page 1: Filepermissions in linux

LINUX FILE PERMISSIONS

Page 2: Filepermissions in linux

WHY FILE PERMISSIONS ?

LINUX….

MULTITASKING SYSTEMMULTIUSER SYSTEMPermissions can be set to files and Directories.

Page 3: Filepermissions in linux

chmod COMMAND

• To change the permissions of a file or directory

• Syntax : chmod assignment_expression

filename• Assignment expression comprises Category of users Granting or denial of permission Types of users

Page 4: Filepermissions in linux

Types of Users

• Owner - owner of the file or directory.

• Group - group of related users.

• All/Other- Other users.

Page 5: Filepermissions in linux

Types of Permissions

• Read - read the file or list files in the directory

• Write - add new content to a file or add new files to the directory

• Execute - access the contents of a file or access files in the directory

Page 6: Filepermissions in linux

WHILE LISTING….

Page 7: Filepermissions in linux

PERMISSION VALUES

Page 8: Filepermissions in linux

VALUES FOR SYMBOLIC MODES

Page 9: Filepermissions in linux

Chmod

• SINGLE USER • Example : • Cmd : chmod u + r filename• The above command grants

permission to a single user to read the file .

Page 10: Filepermissions in linux

Chmod

MULTIUSERS• Example :• Cmd : chmod u + rw , g = x ,o –w

filename• The above command grants permissions to multiple users.

Page 11: Filepermissions in linux

OCTAL NOTATION

Cmd : chmod 761 filenameCmd : chmod u = rwx, g = rw,o = x

filenameThe above commands are equivalent to each other.

Page 12: Filepermissions in linux

EXAMPLES USING OCTAL VALUES

Page 13: Filepermissions in linux

EXAMPLES USING SYMBOLIC NOTATIONS

Page 14: Filepermissions in linux

Chown command

• To change the owner / user of the file / directory.

• An administrator command• Only the root user can change

the owner of the file / directory.• Syntax: chown [options] newowner file/dir

name

Page 15: Filepermissions in linux

Chgrp command

• To change the group of a file / directory.

• An administrator command.• Syntax :

chgrp [options] newgroup file/dirname

Page 16: Filepermissions in linux

THANK YOU