In: Computer Science
Make a copy of the /etc/services file in your home folder. How many times the string “tcp” appear in the file? Provide a screen shot below:
How would you add your account to the wheel group, in the /etc/group file using a one line command? Provide a screen shot below:
Please find the answer for adding a new user account and adding user to wheel group.
Adding the user "smithj":
"useradd" command is invoked to add a new user in linux host.
root@osboxes:/home/osboxes# useradd smithj
root@osboxes:/home/osboxes# grep smithj /etc/passwd
smithj:x:1005:1008::/home/smithj:
Screen Shot:
/etc/services file can be copied by "cp" command:
root@osboxes:~# cp -p /etc/services ~/
root@osboxes:~# grep -c "tcp" services
316
Screen Shot:
Adding the user "smithj" to group "wheel" using "usermod" command
Step 1: If a "wheel" group is not found then use the following command to create a group wheel.
root@osboxes:~# groupadd -g 156 wheel
Step 2: If a group is already present, execute the following commands
root@osboxes:~# usermod -G wheel smithj
root@osboxes:~# grep smithj /etc/group
smithj:x:1008:
wheel:x:156:smithj
Screen Shot: