test 3 Flashcards
Configure NFS service on rhcsa3 and share /rh_share3
with rhcsa4. Configure AutoFS direct map on rhcsa4 to mount
/rh_share3 on /mnt/rh_share4. User user80 (create on both systems)
should be able to create files under the share on the NFS server as
well as under the mount point on the NFS client
dnf install nfs-utils
mkdir /common
chmod 777 /common
firewall-cmd –permanent –add-service nfs
firewall-cmd –reload
systemctl –now enable nfs-server
exportfs -av
or
exportfs -u sever10:/common
on client
mkdir /local
mount server20:/common /local
fstab:
server20:/common /local nfs _netdev 0 0
Task 08: On rhcsa3, create VDO volume called vdo1 on the 4GB
disk with logical size 16GB and mounted with Ext4 structures on
/mnt/vdo1
systemctl status vdo
vdo create –name vdo 1 –device /dev/sdf –vdoLogicalSize 16G
Task 10: Configure NFS service on rhcsa4 and share the home
directory for user60 (create user60 on both systems) with rhcsa3.
Configure AutoFS indirect map on rhcsa3 to automatically mount the
home directory under /nfsdir when user60 logs on to rhcsa3
Server10:
dnf install autofs
edit /etc/auto.misc with:
autoindir server20:/common
systemctl enable –now autofs
Server20:
edit /etc/exports:
/home server10(rw)
sudo exportfs -avr
dnf install autofs - enable service
mkdir
Task 11: On rhcsa4, create Stratis pool pool1 and volume str1 on a
1GB disk and mount it to /mnt/str1.
stratis pool create pool1 /dev/sd1
startis filesystem create pool1 str1
fstab
UUID=”;LAKDJF” /mnt xfs x-systemd.requires=stratisd.service 0 0
Task 12: On rhcsa4, expand Stratis pool pool1 using the other 1GB
disk. Confirm that /mnt/str1 sees the storage expansion.
stratis pool add-data pool1 /dev/sd2
setgid on directory
chmod g+s /testdata
sticky bit on a directory
chmod g+t /testdata
ask 14: On rhcsa3, create directory /var/dir1 with full permissions
for everyone. Disallow non-owners to remove files. Test by creating
file /var/dir1/stkfile1 as user60 and removing it as user80
chmod o+t /var/dir1
Search all man pages and redirect to file
man -k searchitem
man -k password > file.txt
man -k xfs
Task 17: On rhcsa3, install module postgresql version 9.6 (select a
different non-default version if 9.6 is not available).
dnf module list
dnf module info postgresql
dnf module install postgresql
Task 19: On rhcsa3, set SELinux type shadow_t on a new file
testfile1 in /usr and ensure that the context is not affected by a
SELinux relabeling.
chcon -vu user_u -t shadow_t /usr/newfile -R
semanage fcontext
restorecon -R -v /usr/newfile
Task 22: On rhcsa3, launch a named container as user60 with host
port 10000 mapped to container port 80. Employ the latest version of
the ubi7 image. Configure a systemd service to auto-start the
container without the need for user60 to log in. Validate port mapping
using an appropriate podman subcommand.
mkdir ~/.config/systemd/user -p
podman run -dp 10000:80 –name container_name ubi8
podman generate systemd –new –name container_name > ~/.config/systemd/user/container_name.service
podman stop container_name
podman rm container_name
systemctl –user daemon-reload
systemctl –user enable –now conatiner_name.service
loginctl enable-linger
systemctl –user restart container_name
Task 23: On rhcsa3, launch another named container as user60 with
/host_data01 mapped to /container_data01, one variable
ENVIRON=Exam, and host port 1050 mapped to container port
1050. Use the latest version of the ubi8 image. Configure a separate
systemd service to auto-start the container without the need for
user60 to log in. Create a file under the shared directory and validate
data persistence. Verify port mapping and variable settings using
appropriate podman subcommands
podman run -it -e ENVIRON=Exam -p 1050:1050 -v /host_data01:/container_data01:Z –name container_name ubi8