Professional Documents
Culture Documents
Classwork of Lab 2: 1. Create A New User, Naming sv2
Classwork of Lab 2: 1. Create A New User, Naming sv2
Because when I had created sv2 before I took the photos so this is just same
steps as I did.
2. Activate password for sv2 account:
- So after I had created a new user in our system, I needed to activate the
password of that user to provide the security. And it must be so for the full
activation of new user.
- Here is the illustration :
- After that, I logged out to check whether it exists from the outside.
3. Create sv2 directory in home directory:
- We have to back to main user on our system to continue handle with these
things.
- To create sv2 directory in home directory, we use the command following the
syntax below:
”sudo” + ”mkdir” + <name of directory that you would love to>.
- Explanation : “sudo” is used to get the privilege to address with system.
- Here is the illustration :
4. Transfer owner of sv2 directory to sv2 user:
- To transfer owner of a directory to a user, we use the syntax below:
”sudo” + “chown” + <username> + <filename>.
- “sudo” is also used to get the privilege.
- Here is the illustration :
But don’t really care the half above, that just something which is previous one
and I forget clearing it.
5. Similarly create sv3 user following steps 1-4:
- This is what has been done in the above and will repeat to create another one
“sv3”which includes 4 steps:
+ Create a new user using : “sudo” + ”useradd” + <name of user that you
want to create>
+ Activate password using: “sudo” + “passwd” + <user>
+ Create directory using: “mkdir” command
+ Change owner using: “sudo” + “chown” + <user> + <file>
- Here is the illustration:
6. Create the lab2 group:
- Use the command below:
“sudo” + “groupadd” + <name of group> “sudo” is used to get the
privilege to address with system.
- Here is the illustration:
--> It’ll list all the groups and just scroll the pointer down to see “lab2”. It has 2
user which I have added to lab2 above.
9. Rename group lab2 to lab3:
- To change the name of the group from lab2 to lab3, we can use the following
command:
the method is slightly different.
- Use the command below to lock up an account:
- Full illustration :
17. Change the permissions of test.doc file to: Owner has the right to read,
write; Group can read only; Others have no rights at all.
- We can use the ‘chmod’ command which stands for ‘change mode’. Using the
command, we can set permissions (read, write, execute) on a file/directory for
the owner, group and the world.
- Syntax : “chmod” <permissions> <filename>
- Example :
“640” :
+ 6 : read and write (from binary to decimal)
+ 4 : read only (from binary to decimal)
+ 0 : No permission (from binary to decimal)
- Here is the full illustration:
18. Change access to sv2 directory to: “Owner can read, write, execute; Group
can read and write; Other groups read” using octal code.
- We can use the ‘chmod’ command which stands for ‘change mode’. Using the
command, we can set permissions (read, write, execute) on a file/directory for
the owner, group and the world.
- Syntax : “chmod” <permissions> <filename>
- Example :
“764” :
+ 7 : read and write and execute (from binary to decimal)
+ 6 : read and write (from binary to decimal)
+ 4 : read only (from binary to decimal)
- Here is the full illustration:
19. Change the mask so that the files are created from now can read only by the
Owner.
- Use the command below to change the mask as requires: