Lab: Managing Files From The Command Line: Groupadd Command To Create A New Group Called
Lab: Managing Files From The Command Line: Groupadd Command To Create A New Group Called
Lab: Managing Files From The Command Line: Groupadd Command To Create A New Group Called
From the command mode in vim, scroll down to the line that has the Test JJ line of text. Press the
y key twice on your keyboard to copy the line of text and press the p key to paste it below the
cursor. Type :wq to save the changes and quit vim.
From the command mode in vim, scroll down to the line that has the Test HH line of text. Press the
d key twice on your keyboard to delete the line of text. Type :wq to save the changes and quit vim
From the command mode in vim, scroll down to the line that has the Test CC line of text. Press the
i key on the keyboard to switch to the insert mode while keeping the cursor at the beginning of the
Test CC line of text. From the insert mode, press the Enter key on the keyboard to create a blank
line above the cursor. Use the up arrow to navigate to the blank line and create the A new line
line of text. Press the Esc key on the keyboard to switch back to the command mode. Type :wq to
save the changes and quit vim
Use the ln command to create the hard link named /home/student/hardlink to the file
/home/student/grading/grade1.
ln grading/grade1 hardlink
Use the groupadd command to create a new group called database with GID 50000.
[root@serverb ~]# groupadd -g 50000 database
Use the useradd command to create a new user called dbuser1 that uses the group
database as one of its secondary groups.
Use the chage command to force dbuser1 to change its password on first login.
Use the chage command to set the minimum age of the password of dbuser1 to 10 days.
Use the chage command to set the maximum age of the password of dbuser1 to 30 days.
Create the file /etc/sudoers.d/dbuser1 to configure dbuser1 so that the user can use
sudo to run any command as the superuser. You may use the vim /etc/sudoers.d/dbuser1
command to create the file. The /etc/sudoers.d/dbuser1 should contain the following
content.
ssh student@serverb
Use the ssh-keygen command to generate the SSH keys for the user student. The private and
public key files should be named /home/student/.ssh/review3_key and
/home/student/.ssh/review3_key.pub respectively.
ssh-keygen
On servera, configure the user student to accept logins authenticated by the SSH key pair you
created for the user student on serverb. The user student on serverb should be able to log in
to servera using SSH without entering a password.
On serverb, configure the sshd service to prevent users from logging in as root via SSH.
On serverb, configure the sshd service to prevent users from using their passwords to log in. Users
should still be able to authenticate logins using an SSH key pair.
On serverb, configure the sshd service to prevent users from using their passwords to
log in. Users should still be able to authenticate logins using their private key of the SSH key
pair.
Create a tar archive named /tmp/log.tar containing the contents of /var/log on serverb.
Remotely transfer the tar archive to /tmp directory on servera, authenticating as student using
the student user’s private key of the SSH key pair.
Use the sudo tar command to create an archive named /tmp/log.tar as the superuser
containing the contents of /var/log.
Configure the rsyslog service on serverb to log all messages it receives that have the priority
level of debug or higher to the file /var/log/grading-debug. This configuration should be set in
an /etc/rsyslog.d/grading-debug.conf file, which you need to create.
Use the logger command to generate the log message Debug Testing having priority
debug.
Confirm that the log message Debug Testing is saved in the /var/log/grading-debug
file.
Enable the default module stream for the module python36 and install all provided packages from
that stream on serverb.
On serverb, create a new connection profile called static for the available Ethernet
interface. Set the network settings statically so that it does not use DHCP. Base the settings
on the following table:
IPv4 address 172.25.250.111
Netmask 255.255.255.0
Gateway 172.25.250.254
DNS server 172.25.250.254
On serverb, set client-review4 as the canonical host name for the IPv4 address
172.25.250.10 of the host servera.lab.example.com.
Edit the /etc/hosts file to add client-review4 as a name for the 172.25.250.10 IPv4
address.
Use the ping command to verify that you can reach 172.25.250.10 using the canonical host
name client-review4.
Configure the additional IPv4 address 172.25.250.211 with the netmask 255.255.255.0 on the
same interface of serverb that has the existing static network settings. Do not remove the existing
IPv4 address. Make sure that serverb responds to all addresses when the connection you statically
configured on its interface is active.
From workstation, use the ping command to verify that the IPv4 address 172.25.250.211
can be reached.
On serverb, restore the original settings by activating the original network connection.
1. Return to the console and use the nmcli command to activate the original network
profile.
1) On serverb, mount the idle block device containing the XFS file system on the /review5-disk
directory.
Use the lsblk -fs command to determine the idle block device containing the XFS file system.
Use the sudo mkdir command to create the /review5-disk directory as the superuser.
When the sudo command prompts you for a password, give the password student.
Verify that the vdb1 block device is successfully mounted on the /review5-disk
directory.
2) On serverb, locate the file named review5-path. Record its absolute path in the /review5-
disk/review5-path.txt text file.
Use the find command to locate the file called review5-path. Redirect all the errors of the
find command to /dev/null. This redirection allows you to discard any error from the
output of the find command.
You may use the sudo vim /review5-disk/review5-path.txt command to create the text file.
Type :wq! from the command mode in vim to save the changes and quit from the file. The
following output shows the content of the /review5-disk/review5-path.txt text file.
/var/tmp/review5-path
3) On serverb, locate all the files having contractor1 and contractor as the owning user and
group, respectively. The files must also have the octal permissions of 640. Save the list of these files
in /review5-disk/review5-perms.txt.
/usr/share/review5-perms
You may use the sudo vim /review5-disk/review5-perms.txt command to create the text
file. Type :wq! from the command mode in vim to save the changes and quit from the file.
The following output shows the content of the /review5-disk/review5-perms.txt text
file.
/usr/share/review5-perms
4) On serverb, locate all files 100 bytes in size. Save the absolute paths of these files in /review5-
disk/review5-size.txt.
You may use the sudo vim /review5-disk/review5-size.txt command to create the text file.
Type :wq! from the command mode in vim to save the changes and quit from the file. The
/review5-disk/review5-size.txt text file should contain the absolute path to the
review5-size file among other paths.
...output omitted...
/opt/review5-size
...output omitted...