Creating the Minstrel's Tome
In this step, you will create the ancient tome that the minstrel intends to share with the city's inhabitants. Begin by crafting the tome as a text file and setting its initial permissions to reflect that only the minstrel (the file owner) can read and write to the tome while preventing others from viewing its contents.
Navigate to the working directory:
cd ~/project
Create the tome file named ancient_tome.txt
:
touch ancient_tome.txt
Set the initial permissions:
chmod 600 ancient_tome.txt
This command modifies the permissions of ancient_tome.txt
, granting read and write access to the owner, with neither the group nor others having any access.
See here for a detailed explanation:
chmod
: is a Unix/Linux command used to change the permissions of files or directories.
600
: This is the permission mode, which controls the permissions of files.
- The first number
6
represents the permissions of the file owner (user).
- The second number
0
represents the permissions of the group to which the file belongs (Group).
- The third number
0
represents the permissions of other users (Other).
Description of the permission numbers:
4
means read permission (Read), corresponding to the number r
.
2
means write permission, corresponding to the number w
.
1
means execute permission, corresponding to the number x
.
The meaning of chmod 600
:
6
means that the file owner has read and write permission.
0
means that the group to which the file belongs and other users have no permissions.
So only the file owner can read and write ancient_tome.txt
, while other users have no permissions.
Verify the permissions:
ls -l ancient_tome.txt
The output should resemble:
-rw------- 1 labex labex 0 date time ancient_tome.txt