In: Computer Science
linux:
Exit from being the root user and use the following command to
“become” the labsevenuser. Use the man page to tell me what the –
(dash) option does for the su command in the space below. The
command “su” stands for switch user.
$ su – labsevenuser
Explanation of – (dash):
1.create a new user on your system called labsevenuser.
$ sudo useradd labsevenuser
useradd is a command in Linux that is used to add user accounts to your system.
sudo gives escalated priviledges to user but require the admin password.
2.Set a new password for the new user you just created.
$ sudo passwd labsevenuser
passwd command in Linux is
used to change the user account passwords.
--This command will propt you to enter and confirm the
password.
3.Create a new group called awesomepeople. Add the user you created in that group.
groupadd command creates a new group
account using the values specified on the command line and the
default values from the system.
$ sudo groupadd awesomepeople
$ sudo usermod -a -G awesomepeople labsevenuser
usermod command or modify user is a command in Linux that is used to change the properties of a user in Linux through the command line
4.Paste the last 5 lines of the /etc/group and /etc/passwd here to show that you executed the commands above.
The /etc/group is a text file which defines the groups to which users belong under Linux and UNIX operating system.
/etc/passwd is a text file that contains the attributes of (i.e., basic information about) each user or account on a computer running Linux
/etc/group:
postdrop:x:90:
postfix:x:89:
chrony:x:996:
labsevenuser:x:1000:
awesomepeople:x:1001:labsevenuser
6. $ su – labSevenUser
If you have any doubts, leave a comment below and I'll help you out.