15 RHCSA9 | EX200 Exam | autofs

preview_player
Показать описание
# Question 15
# Perform following task on "node02" as "rhcsa9" user

Configure autofs to automount the home directories of user "userautofs01".

Note the following:
userautofs01 home directory should be auto mounted locally at "/shared" as "/shared/userautofs01"
Home directories must be writable by the users when you login as "userautofs01" on "node02"

# Solution 15

#######################################
--configure nfs server share directory
#######################################

-- Install required packages
sudo dnf install -y nfs* rpc*

-- enable and start nfs-server
sudo systemctl enable --now nfs-server
sudo systemctl status nfs-server

-- create shared directory
sudo mkdir /shared
sudo chmod 777 /shared

-- configure nfs share
sudo vi /etc/exports
/shared 10.10.10.93(rw,no_root_squash)

-- export nfs-share
sudo exportfs -avr

-- configure firewall
sudo firewall-cmd --add-service={nfs,mountd,rpc-bind} --permanent
sudo firewall-cmd --reload

-- create a user for demo purpose
sudo groupadd -g 1234 autofsusers
sudo useradd -d /shared/userautofs01 -u 1234 -g autofsusers userautofs01
sudo passwd userautofs01


#######################################
--configure autofs on node02
#######################################

- user "userautofs01" must already be present on node02
- we will create identical group and user on node02 as it is expected to be present on node02 server

sudo groupadd -g 1234 autofsusers
sudo useradd -d /shared/userautofs01 -u 1234 -g autofsusers userautofs01
sudo passwd userautofs01

---------------------------------------------------------------------------

- Install the autofs package if it is not already installed:

sudo yum install -y autofs nfs-utils

- Edit the autofs master configuration file using a text editor. For example:

- Add the following line to the end of the file:

- Add the following line to the file:

- Save the changes to the file and exit the text editor.
- Reload the autofs configuration for the changes to take effect:

sudo systemctl restart autofs

- Verify that the home directory is mounted correctly by switching the user on node02

su - userautofs01

- This command should show the contents of the userautofs01 home directory.

## Reference document

Thank you
Enjoy !!
Рекомендации по теме
Комментарии
Автор

thank you Tech Mate, you are a life saver 😀

zympf
Автор

Thanks so much for these RHCSA videos! They're a great help!

tonyb
Автор

i took the exam ex200. I did everything in the autofs but at the end I went to firewall-cmd --list-all and didn't see autofs. I tried to add it but it wouldn't let me.

eddey
Автор

For configuring AutoFS on the client machine, do we make any entry in the /etc/fstab file? Also, on the client machine, in /etc/auto.master file, do we specify the path only from server or is this the path on client machine ???? Please get back on this.

das
Автор

i noticed that on the server side you added nfs to the firewall. I also noticed that on the client side you did not add autofs to the client

eddey
Автор

thank you for the amazing video i have a question in test the user will be already created do i need to usermod -d and change the home diractory to the shared one ??

Migren
Автор

Great videos! In the exam settings, do we have to configure the server ( "--configure nfs server share directory"), or is the server going to be already configured?

simonpierrepountougnigni
Автор

i tried exactly the same configuration and is not working

sigma-ynqd