Professional Documents
Culture Documents
Ch-6-Lab: Permissions: Objective: Pre-Requisite: Topology
Ch-6-Lab: Permissions: Objective: Pre-Requisite: Topology
OBJECTIVE:
To assign permissions for files and directories
PRE-REQUISITE:
Machine with Linux Installed
TOPOLOGY:
Result:
root
5. Set write permissions to the group level only by using Symbolic Mode
Syntax:
[root@localhost myfolder]# chmod <permission_mode> <file/dir_name>
[root@localhost myfolder]# chmod g+w test_file
Verification:
[root@localhost myfolder]# Is -Id test_file
-rw-rw-r--1 root root 0 Sep 1 00:06 test_file
Verification:
[root@localhost myfolder]# Is -Id test_file
-rw-rw— 1 root root 0 Sep 1 00:06 test_file
7. Assign read, write and execute permissions to others only by using symbolic
mode
Verification:
[root@localhost myfolder]# Is -Id test_file
.,-rw-rw-rwx 1 root root 0 Sep 1 00:06 test_file
Verification:
[root@localhost myfolder]# Is -Id test_file
-rwxrwxrwx 1 root root 0 Jul 13 00:06 test_file
9. Remove write and execute permissions from group and others also.
[root@localhost myfolder]# chmod g-wx,o-wx test_file Verification:
[root@localhost myfolder]# Is -Id test_file
-rw-r-r-1 root root 0 Sep 1 00:06 test_file
Syntax:
[root@ local host myfolder]# chmod <permission_modexfile/dir>
[root@localhost myfolder]# chmod 646 test_file
Verification:
[root@localhost myfolder]# Is -Id test_file
-rw-r--rw-1 root root 0 sep 1 00:06 test_file
11. Assign full permissions to owner, group and others on admin directory
using Absolute Mode
12. Assign full permissions to owner, group and others on admin directory using
Symbolic Mode
13. To find result, add a normal user and try to access file as a normal user
[root@localhost myfolder]# useradd zoomuser
[root@localhost myfolder]# su – zoomuser
[zoomuser@localhost ~]$ cd /root/myfolder
Verification:
[zoomuser@localhost myfolder]$ cat»test_file This is a zoom user file Ctrl+d (to
save data)
[zoomuser@localhost myfolder]$ cat test_file
This is a zoom user file
Verification:
[root@localhost ~]# Is-ld /root
drwxrwxrwx 2 root root 4096 Sep 1 02:22 /root
Note: user can read and write in file because file is having read and write
permissions on other level
END