Solution:
To create a file with ONLY execute rights for the user, group and other users:
shell
Copy code
$ cd /home/afnog
$ touch [Link]
$ chmod 111 [Link]
$ ls -l [Link]
The output of the last command should be:
css
---x--x--x 1 afnog afnog 0 Aug 5 16:07 [Link]
To create a file with ONLY readonly rights for the user, group and other users:
shell
Copy code
$ cd /home/afnog
$ touch [Link]
$ chmod 444 [Link]
$ ls -l [Link]
The output of the last command should be:
css
-r--r--r-- 1 afnog afnog 0 Aug 5 16:09 [Link]
To create a file with rwx rights ONLY for the owner (user) and no rights for anyone else:
shell
$ cd /home/afnog
$ touch [Link]
$ chmod 700 [Link]
$ ls -l [Link]
The output of the last command should be:
diff
Copy code
-rwx------ 1 afnog afnog 0 Aug 5 16:10 [Link]
To create a file with Owner (user) rights of rwx, Group Rights of x (only), Other user rights of r (only):
shell
Copy code
$ cd /home/afnog
$ touch [Link]
$ chmod 751 [Link]
$ ls -l [Link]
The output of the last command should be:
-rwx--xr-- 1 afnog afnog 0 Aug 5 16:11 [Link]
To check that all the files have been created with the correct permissions, run the command:
$ ls -l
The output should be:
diff
-r--r--r-- 1 afnog afnog 0 Aug 5 16:09 [Link]
---x--x--x 1 afnog afnog 0 Aug 5 16:07 [Link]
-rwx--xr-- 1 afnog afnog 0 Aug 5 16:11 [Link]
-rwx------ 1 afnog afnog 0 Aug 5 16:10 [Link]
This confirms that all the files have been created with the correct permissions as specified in the
assignment.