Professional Documents
Culture Documents
Chapter 4 - Maintaining Security - v2
Chapter 4 - Maintaining Security - v2
Chapter 4:
Maintaining Security
Objectives
• Use chmod to change file permissions in an
absolute manner
• Learn how the administrator uses three basic file
permissions bits
• Use chown and chgrp to change the owner and
group owner of files
• Restrict a user’s activities with the restricted
shell
Introduction
• Security in a computer system eventually
involves files
• Faulty file permission – exploit by malicious user
• System Administrator’s responsibility - ensure
that system directories (/bin, /usr/bin, /etc, /sbin)
and files in them are not writable by others
Very important to be
Linux Structure
protected!
• Tune in to
https://www.youtube.com/watch?v=D-VqgvBMV
7g&t=143s
Last
Number Owner modification
of links Name date & time
$ ls –l
total 2
drwxrw-r-- 1 ixo team 0 2012-08-30 18:42 Material
-rwxr-xr-x 1 dc010101 dba 5234 2012-12-20 22:22 file1.txt
group
rwxr-xr-x Example:
Access permission for file1.txt
owner world
chmod
chown
chgrp
Change File Permission
• chmod command: change file permission
• Method: Absolute assignment
– Done with octal numbers (base 8)
– A set of 3 bits represent one octal digit
• Example:
$ chmod 754 file1.txt
• General structure
chmod <newPermissionInOctal> <filename>
Change File Permission
• Example:
$ chown dc010101 Material
• General structure
chown <newUserName> <filename>
Exercise
• Change owner name of ‘Avengers’ file to
‘Hulk’
Change File Group Owner
• chgrp command: change a file’s group owner
• A user can change the group owner of a file, but
only to a group to which he/she belongs to
• Example:
• General structure
chgrp <NewGroupName> <FileName>
Exercise
Change group name of ‘Drama’ file to
‘section01’.
Answer:-
STERN REMINDER! For chown and chgrp!