Here are all the actual test exam dumps for IT exams. Most people prepare for the actual exams with our test dumps to pass their exams. So it's critical to choose and actual test pdf to succeed.
Actual exam question for RedHat's EX200 exam Question #: 28 Topic #: 2
Configure autofs Configure autofs to automatically mount the home directory of a remote user as described below: - materials.example.com (172.25.254.254) exports /rhome via NFS to your system. This filesystem contains a pre-configured home directory for the user remoteuser1. - The home directory of remoteuser1 is materials.example.com:/rhome/remoteuser1. - The home directory of remoteuser1 should be automatically mounted locally at /rhome/remoteuser1. - The home directory must be writable by the user. - The password for remoteuser1 is "flectrag".
Suggested Answer:
# 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=172.25.254.254)
1 Install Necessary Packages Ensure autofs and nfs-utils are installed on your system: sudo dnf install -y autofs nfs-utils 2 Verify Remote NFS Share Check if the remote NFS export is available: showmount -e 172.25.254.254 You should see something like: Export list for 172.25.254.254: /rhome * 3 Configure autofs Master Map File Edit the /etc/auto.master.d/home.autofs file (create it if it doesn't exist): sudo nano /etc/auto.master.d/home.autofs Add the following line: /rhome /etc/auto.rhome This tells autofs to reference the file /etc/auto.rhome for mounting under /rhome.
4 Create the Map File for /rhome Create the /etc/auto.rhome file: sudo nano /etc/auto.rhome Add the following entry:
remoteuser1 -rw,sync 172.25.254.254:/rhome/remoteuser1 -rw,sync: Ensures the filesystem is mounted read-write with synchronous writes. 172.25.254.254:/rhome/remoteuser1: Specifies the remote NFS share. 5 Set Correct Permissions Ensure the /rhome directory exists: sudo mkdir -p /rhome Set appropriate permissions for the /rhome directory: sudo chmod 755 /rhome 6 Enable and start the autofs service: sudo systemctl enable autofs --now 7 Test the Configuration Attempt to access the mounted home directory: ls /rhome/remoteuser1 If everything is configured correctly, the directory should be automatically mounted, and you can access its contents. 8 Verify Write Access Switch to the user remoteuser1 and verify write access: su - remoteuser1 When prompted, enter the password: flectrag echo "Test file" > /rhome/remoteuser1/testfile cat /rhome/remoteuser1/testfile 9 Test SSH Login to localhost Now, log in as remoteuser1 via SSH: ssh remoteuser1@localhost When prompted, enter the password: flectrag 10 After logging in, verify that you are in the correct home directory: pwd Output should be: /rhome/remoteuser1 Check the directory contents: ls -la Test write access: echo "Testing SSH login" > testfile cat testfile If successful, the home directory is writable.
upvoted 1 times
...
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Is the comment made by USERNAME spam or abusive?
Commenting
In order to participate in the comments you need to be logged-in.
You can sign-up / login
(it's free).
Comments
ubiquituz
2024-11-25 15:12:04Install Necessary Packages
Ensure autofs and nfs-utils are installed on your system:
sudo dnf install -y autofs nfs-utils
2
Verify Remote NFS Share
Check if the remote NFS export is available:
showmount -e 172.25.254.254
You should see something like:
Export list for 172.25.254.254:
/rhome *
3
Configure autofs Master Map File
Edit the /etc/auto.master.d/home.autofs file (create it if it doesn't exist):
sudo nano /etc/auto.master.d/home.autofs
Add the following line:
/rhome /etc/auto.rhome
This tells autofs to reference the file /etc/auto.rhome for mounting under /rhome.
4
Create the Map File for /rhome
Create the /etc/auto.rhome file:
sudo nano /etc/auto.rhome
Add the following entry:
remoteuser1 -rw,sync 172.25.254.254:/rhome/remoteuser1
-rw,sync: Ensures the filesystem is mounted read-write with synchronous writes.
172.25.254.254:/rhome/remoteuser1: Specifies the remote NFS share.
5
Set Correct Permissions
Ensure the /rhome directory exists:
sudo mkdir -p /rhome
Set appropriate permissions for the /rhome directory:
sudo chmod 755 /rhome
6
Enable and start the autofs service:
sudo systemctl enable autofs --now
7
Test the Configuration
Attempt to access the mounted home directory:
ls /rhome/remoteuser1
If everything is configured correctly, the directory should be automatically mounted, and you can access its contents.
8
Verify Write Access
Switch to the user remoteuser1 and verify write access:
su - remoteuser1
When prompted, enter the password:
flectrag
echo "Test file" > /rhome/remoteuser1/testfile
cat /rhome/remoteuser1/testfile
9
Test SSH Login to localhost
Now, log in as remoteuser1 via SSH:
ssh remoteuser1@localhost
When prompted, enter the password:
flectrag
10
After logging in, verify that you are in the correct home directory:
pwd
Output should be:
/rhome/remoteuser1
Check the directory contents:
ls -la
Test write access:
echo "Testing SSH login" > testfile
cat testfile
If successful, the home directory is writable.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).