rhcsa 8 exam with correct answers
1. reboot your server. assume that you don't know the root password, and use the
appropriate mode to enter a root shell that doesn't require password. Set the root
password to mypassword. - Answer -1. in the boot loader menu:
press e
2.at the end of the line begging with the Linux, at the end of this line, append the
following:
init=/bin/sh
3.press ctrl-x
4.load the installed SELinux policy:
/usr/sbin/load_policy -i
5-execute the following command you root partition:
mount -o remount,rw /
6-reset the root password:
passwd root
7-remount the root partition:
mount -o remount,ro /
8-press ctrl-d
2. change runlevel? - Answer -step1: check a default runlevel system configuration:
systemctl get-default
step2:set default runlevel target unit to multi-user:
systemctl set-default multi-user.target
step2:set default runlevel target unit to graphical:
systemctl set-default graphical.target
step4:reboot
or if you want to change runlevel without restarting:
systemctl isolate multi-user
3. set default values for new users. set default password validity to 90 days, and set the
first UID that is used for new users to 2000. - Answer -vi /etc/login.defs
change the following values:
PASS_MAX_DAYS 90
UID_MIN 2000
4.create users edwin and santos and make them members of the group
livingopensource as a secondary group membership. Also, create users serene and
, alex and make them members of the group operation as a secondary group.grop -
Answer -1.useradd edwin
2.passwd edwin
3.useradd santos
4.usermod santos
5.useradd serene
6.usemod serene
7.useradd alex
8.passwd alex
9.groupadd livingopensource
10.groupadd operations
11.usermod -aG livingopensource edwin
12.usermod -aG livingopensource santos
13.usermod -aG operations serene
14.usermode -aG operations alex
5.Configure your host name, ip address, Gateway and DNS.
Host name: station.domain40.example.com
/etc/sysconfig/network
hostname=abc.com
hostname abc.com
ip Address:172.24.40.40/24
Gateway172.24.40.1
dns: 172.24.40.1 - Answer -1.#nmtui edit ens33
ipv4 configuration <manual>
addresses <172.24.40.40/40>
Gateway <172.24.40.1>
DNS severs <172.24.40.1>
quit
2.ifdown ens33
3.ifup ens33
4.hostnamectl set-hostname station.domain40.example.com
6.Create shared group directories/groups/livingopensource and /groups/operations, and
make sure the groups meet the following requirements:
■ Members of the group livingopensource have full access to their directory.
■ Members of the group operations have full access to their directory.
■ New files that are created in the group directories.
■ Others have no access to the group directories.
■ Members of the group operations have read access to the
directory/groups/livingopensource. - Answer -1.mikdr -p /groups/livingopensource
2.mikdir -p /groups/operations
3. chgrp livingopensource /groups/livingopensource
4. chgrp operations /groups/operations
5.chmod g+s /groups/livingopensource
6.chmod g+s /groups/operations
1. reboot your server. assume that you don't know the root password, and use the
appropriate mode to enter a root shell that doesn't require password. Set the root
password to mypassword. - Answer -1. in the boot loader menu:
press e
2.at the end of the line begging with the Linux, at the end of this line, append the
following:
init=/bin/sh
3.press ctrl-x
4.load the installed SELinux policy:
/usr/sbin/load_policy -i
5-execute the following command you root partition:
mount -o remount,rw /
6-reset the root password:
passwd root
7-remount the root partition:
mount -o remount,ro /
8-press ctrl-d
2. change runlevel? - Answer -step1: check a default runlevel system configuration:
systemctl get-default
step2:set default runlevel target unit to multi-user:
systemctl set-default multi-user.target
step2:set default runlevel target unit to graphical:
systemctl set-default graphical.target
step4:reboot
or if you want to change runlevel without restarting:
systemctl isolate multi-user
3. set default values for new users. set default password validity to 90 days, and set the
first UID that is used for new users to 2000. - Answer -vi /etc/login.defs
change the following values:
PASS_MAX_DAYS 90
UID_MIN 2000
4.create users edwin and santos and make them members of the group
livingopensource as a secondary group membership. Also, create users serene and
, alex and make them members of the group operation as a secondary group.grop -
Answer -1.useradd edwin
2.passwd edwin
3.useradd santos
4.usermod santos
5.useradd serene
6.usemod serene
7.useradd alex
8.passwd alex
9.groupadd livingopensource
10.groupadd operations
11.usermod -aG livingopensource edwin
12.usermod -aG livingopensource santos
13.usermod -aG operations serene
14.usermode -aG operations alex
5.Configure your host name, ip address, Gateway and DNS.
Host name: station.domain40.example.com
/etc/sysconfig/network
hostname=abc.com
hostname abc.com
ip Address:172.24.40.40/24
Gateway172.24.40.1
dns: 172.24.40.1 - Answer -1.#nmtui edit ens33
ipv4 configuration <manual>
addresses <172.24.40.40/40>
Gateway <172.24.40.1>
DNS severs <172.24.40.1>
quit
2.ifdown ens33
3.ifup ens33
4.hostnamectl set-hostname station.domain40.example.com
6.Create shared group directories/groups/livingopensource and /groups/operations, and
make sure the groups meet the following requirements:
■ Members of the group livingopensource have full access to their directory.
■ Members of the group operations have full access to their directory.
■ New files that are created in the group directories.
■ Others have no access to the group directories.
■ Members of the group operations have read access to the
directory/groups/livingopensource. - Answer -1.mikdr -p /groups/livingopensource
2.mikdir -p /groups/operations
3. chgrp livingopensource /groups/livingopensource
4. chgrp operations /groups/operations
5.chmod g+s /groups/livingopensource
6.chmod g+s /groups/operations