RedHat Red Hat Certified System Administrator - RHCSA (EX200日本語版) - EX200日本語 Exam Practice Test

autofsを設定する
以下に説明するように、autofsを設定してリモートユーザーのホームディレクトリを自動的にマウントします。
- materials.example.com (172.25.254.254) は、NFS を介して /rhome をシステムにエクスポートします。このファイルシステムには、ユーザー用に事前に設定されたホームディレクトリが含まれています。
リモートユーザー1。
- remoteuser1 のホームディレクトリは materials.example.com:/rhome/remoteuser1 です。
- remoteuser1 のホームディレクトリは、/rhome/remoteuser1 にローカルに自動的にマウントされる必要があります。
ホームディレクトリはユーザーが書き込み可能である必要があります。
- remoteuser1 のパスワードは「flectrag」です。
Correct Answer:
Solution:
# Preparations (not required for the exam)
# Go back to foundation0, remote into classroom, create the remoteuser1 user and directory.
# This step is necessary to avoid issues with autofs mounting during testing.
[kiosk@foundation0 ~]$ ssh root@classroom 'useradd -u 1010 remoteuser1 && mkdir -p /rhome/remoteuser1 && chown remoteuser1: /rhome/remoteuser1'
# Install nfs-utils and autofs
[root@node1 ~]# yum -y install nfs-utils autofs
[root@node1 ~]# vim /etc/auto.master
/rhome /etc/auto.rhome
[root@node1 ~]# vim /etc/auto.rhome
remoteuser1 -rw materials.example.com:/rhome/remoteuser1
[root@node1 ~]# systemctl enable --now autofs
# Verification
[root@node1 ~]# ll /rhome/
[root@node1 ~]# ssh remoteuser1@localhost
remoteuser1@localhost\'s password: `flectrag`
$ pwd
/rhome/remoteuser1
$ touch my.file
$ mount | grep rhome
...
materials.example.com:/rhome/remoteuser1 on /rhome/remoteuser1 type nfs4
(`rw`,relatime,vers=4.2,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.25.250.100,local_lock=none,addr=1
72.25.254.254)
/usr/local ディレクトリ内で 3KB より大きく 5KB より小さいファイルを探し、それらを /root/d1 にコピーし、ターゲットディレクトリに SGID を設定します。
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
mkdir -p /root/d1
find /usr/local -type f -size +3k -size -5k -exec cp -rvf {} /root/d1/ \;
chmod g+s /root/d1
ls -ld /root/d1
Detailed Explanation:
* -size +3k means greater than 3 KB.
* -size -5k means less than 5 KB.
* chmod g+s sets the SGID bit on the directory.
* SGID on a directory causes new files created there to inherit the directory's group.
/dev/sdb上に、1つのパーティション、物理ボリューム、ボリュームグループ、論理ボリューム、およびXFSファイルシステムを含むLVMストレージを作成します。
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
* Partition the disk:
fdisk /dev/sdb
Inside fdisk:
* n = new partition
* p = primary
* 1 = partition number
* accept defaults
* size +700M
* t = change type
* set Linux LVM type
* w = write changes
* Create the physical volume:
pvcreate /dev/sdb1
* Create the volume group:
vgcreate vg_data /dev/sdb1
* Create the logical volume:
lvcreate -L 500M -n lv_data vg_data
* Create the filesystem:
mkfs.xfs /dev/vg_data/lv_data
Detailed Explanation:
* The lab specifies a 700 MB partition and a 500 MB logical volume.
* pvcreate initializes the partition for LVM.
* vgcreate builds the storage pool.
* lvcreate allocates space from the volume group.
* mkfs.xfs creates the filesystem, which is standard on RHEL.
HTTPサービスを永続的に許可するようファイアウォールルールを設定してください。
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
firewall-cmd --permanent --add-service=http
firewall-cmd --reload
firewall-cmd --list-services
Detailed Explanation:
* --permanent saves the rule.
* --reload applies it.
* --list-services verifies the active configuration.
* Firewalld remains the standard firewall interface in RHEL 10. ( Red Hat Documentation )
ユーザーアカウントを作成する
以下のユーザーアカウントを作成し、チェックボックスが有効になっていることを確認してください。
- sysmgrs という名前のグループ
- ユーザー natasha は、セカンダリ グループとして sysmgrs グループに属しています。
- ユーザー harry は、セカンダリ グループとして sysmgrs グループに属しています。
- ユーザー sarah は、システム上の対話型シェルへのアクセス権がなく、sysmgrs のメンバーでもありません。
ナターシャ、ハリー、サラのパスワードはすべて「flectrag」にしてください。
Correct Answer:
Solution:
[root@node1 ~]# groupadd sysmgrs
[root@node1 ~]# useradd -G sysmgrs natasha
[root@node1 ~]# useradd -G sysmgrs harry
[root@node1 ~]# useradd -s /bin/false sarah
[root@node1 ~]# echo tianyun |passwd --stdin natasha
[root@node1 ~]# echo tianyun |passwd --stdin harry
[root@node1 ~]# echo tianyun |passwd --stdin sarah
/dev/sdc 上に pool1 という名前の Stratis プールを作成し、fs1 という名前のファイルシステムを作成します。
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
dnf install -y stratisd stratis-cli
systemctl enable --now stratisd
stratis pool create pool1 /dev/sdc
stratis filesystem create pool1 fs1
stratis filesystem list
Detailed Explanation:
* stratisd is the daemon and stratis-cli provides the command-line interface.
* A Stratis pool is created from a block device.
* The Stratis file system is then created inside that pool.
* RHEL 10 documents Stratis as an available volume-managing file-system layer. ( Red Hat
Documentation )
/etc の圧縮アーカイブを作成し、そのファイルの種類を確認してください。
Correct Answer:
See the solution below in Explanation.
Explanation:
Solution:
tar -zvcf /root/etc_backup.tar.gz /etc
file /root/etc_backup.tar.gz
Detailed Explanation:
* tar creates the archive.
* -z uses gzip compression.
* -v is verbose.
* -c creates the archive.
* -f names the output file.
* file confirms the resulting archive type.
0
0
0
0