Part 1 (on Node1 Server)
Task 16 [Running Containers]
Configure your host journal to store all journal across reboot
Copy all journal files from /var/log/journal/ and put them in the /home/shangrila/container-logserver Create and mount /home/shangrila/container-logserver as a persistent storage to the container as /var/log/ when container start
正解:
* [shangrila@node1 ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d5ffe018a53c registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 5 seconds ago Up 4 seconds ago logserver
[shangrila@node1 ~]$ podman stats logserver
Error: stats is not supported in rootless mode without cgroups v2
[shangrila@node1 ~]$ podman stop logserver
d5ffe018a53ca7eb075bf560d1f30822ab6fe51eba58fd1a8f370eda79806496
[shangrila@node1 ~]$ podman rm logserver
Error: no container with name or ID logserver found: no such container
[shangrila@node1 ~]$ mkdir -p container-journal/
* [shangrila@node1 ~]$ sudo systemctl restart systemd-journald
[sudo] password for shangrila:
[shangrila@node1 ~]$ sudo cp -av /var/log/journal/* container-journal/
[shangrila@node1 ~]$ sudo cp -av /var/log/journal/* container-journal/
[shangrila@node1 ~]$ sudo chown -R shangrila container-journal/
[shangrila@node1 ~]$ podman run -d --name logserver -v /home/shangrila/container-journal/:/var/log/journal:Z registry.domain15.example.com:5000/rhel8/rsyslog
[shangrila@node1 ~]$ podman ps
[shangrila@node1 ~]$ loginctl enable-linger
[shangrila@node1 ~]$ loginctl show-user shangrila|grep -i linger
Linger=yes
* [shangrila@node1 ~]$ podman stop logserver
[shangrila@node1 ~]$ podman rm logserver
[shangrila@node1 ~]$ systemctl --user daemon-reload
[shangrila@node1 ~]$ systemctl --user enable --now container-logserver
[shangrila@node1 ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3903e1d09170 registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 4 seconds ago Up 4 seconds ago logserver
[shangrila@node1 ~]$ systemctl --user stop container-logserver.service
* [shangrila@node1 ~]$ sudo reboot
[shangrila@node1 ~]$ podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7e6cd59c506a registry.domain15.example.com:5000/rhel8/rsyslog:latest /bin/rsyslog.sh 10 seconds ago Up 9 seconds ago logserver
質問 2:
Part 1 (on Node1 Server)
Task 3 [Managing Local Users and Groups]
Create the following users, groups and group memberships:
A group named sharegrp
A user harry who belongs to sharegrp as a secondary group
A user natasha who also belongs to sharegrp as a secondary group
A user copper who does not have access to an interactive shell on the system and who is not a member of sharegrp.
harry, natasha and copper should have the password redhat
正解:
* [root@node1 ~]# groupadd sharegrp
[root@node1 ~]# useradd harry
[root@node1 ~]# useradd natasha
[root@node1 ~]# usermod -aG sharegrp harry
[root@node1 ~]# usermod -aG sharegrp natasha
[root@node1 ~]# useradd -s /sbin/nologin copper
[root@node1 ~]# echo "redhat" | passwd --stdin harry
[root@node1 ~]# echo "redhat" | passwd --stdin natasha
[root@node1 ~]# echo "redhat" | passwd --stdin copper
### For Checking ###
[root@node1 ~]# su - copper
This account is currently not available.
[root@node1 ~]# su - natasha
[root@node1 ~]# id
[root@node1 ~]# su - harry
[root@node1 ~]# id
質問 3:
User mary must configure a task.
Requirement: The local time at 14:23 every day echo "Hello World.".
正解:
crontab -u mary -e
23 14 * * * echo "Hello World."
質問 4:
Part 2 (on Node2 Server)
Task 1 [Controlling the Boot Process]
Interrupt the boot process and reset the root password. Change it to kexdrams to gain access to the system
正解:
* 1. Reboot the server pressing by Ctrl+Alt+Del
2. When the boot-loader menu appears, press the cursor keys to highlight the default boot-loader entry
3. Press e to edit the current entry.
4. Use the cursor keys to navigate to the line that starts with linux.
5. Press End to move the cursor to the end of the line.
6. Append rd.break to the end of the line.
7. Press Ctrl+x to boot using the modified configuration.
8. At the switch_root prompt
* switch_root:/# mount -o remount,rw /sysroot
switch_root:/# chroot /sysroot
sh-4.4# echo kexdrams | passwd --stdin root
Changing password for user root.
passwd: all authentication tokens updated successfully.
sh-4.4# touch /.autorelabel
sh-4.4# exit; exit
* Type exit twice to continue booting your system as usual.
質問 5:
Part 2 (on Node2 Server)
Task 2 [Installing and Updating Software Packages]
Configure your system to use this location as a default repository:
http://utility.domain15.example.com/BaseOS
http://utility.domain15.example.com/AppStream
Also configure your GPG key to use this location
http://utility.domain15.example.com/RPM-GPG-KEY-redhat-release
正解:
[root@node1 ~]# vim /etc/yum.repos.d/redhat.repo
[BaseOS]
name=BaseOS
baseurl=http://utility.domain15.example.com/BaseOS
enabled=1
gpgcheck=1
gpgkey=http://utility.domain15.example.com/RPM-GPG-KEY-redhat-release
[AppStream]
name=AppStream
baseurl=http://utility.domain15.example.com/AppStream
enabled=1
gpgcheck=1
gpgkey=http://utility.domain15.example.com/RPM-GPG-KEY-redhat-release
[root@node1 ~]# yum clean all
[root@node1 ~]# yum repolist
repo id repo name
AppStream AppStream
BaseOS BaseOS
[root@node1 ~]# yum list all
Tate -
先日貴社より問題集を購入しました。
該当試験に無事で合格しました。やはり高い的中率がありますよね。
これからも他の試験を受ける予定ですが、またよろしくね。