Linux Identity Management and File Sharing

preview_player
Показать описание
The CIO of Eucalyptus and Lavender would like you to configure a new NFS server with a file share named /ops. Once the file share is configured, make sure that you can mount it on the client node!

Solution
In separate tabs, log into server1 and server2 using the corresponding public IP and credentials provided on the lab page:

Run the sudo -i command to gain root access for each server.

Note: When copying and pasting code into Vim from the lab guide, first enter :set paste (and then i to enter insert mode) to avoid adding unnecessary spaces and hashes. To save and quit the file, press Escape followed by :wq. To exit the file without saving, press Escape followed by :q!.

Install NFS and Create and Export the File System
Install NFS and Create the File System
Install NFS on server1:

yum install -y nfs-utils
After installation has completed, create a directory and change permissions:

mkdir /ops
chmod 777 /ops
Configure the NFS share:

vim /etc/exports
Run i to enter insert mode.

Configure the server:

/ops *(rw)
To save and quit the file, press Escape followed by :wq.

Start the NFS service:

systemctl start nfs-server
Export the File System
Export the /etc/ directory:

exportfs -a
Run the exportfs command to confirm /ops successfully exported to world.

Enter the ifconfig -a command to show the IP address for server1.

Copy the IP address and click into the server2 client node.

Install NFS on the Client and Mount the File System
In the server2 client node, install NFS:

yum install -y nfs-utils
After installation has completed, create the directory for the mount:

mkdir -p /mnt/ops
chmod 777 /mnt/ops
Mount the file system:

vim /etc/fstab
Underneath the mount information, enter i to insert a new line.

Paste the IP address for server1 to create the persistent mount:

server1_IP_ADDRESS:/ops /mnt/ops nfs rw 0 0
To save and quit the file, press Escape followed by :wq.

Mount the file system:

mount -a
Run the df command to verify the file system has been mounted from server1 as a local file system.
Рекомендации по теме
visit shbcf.ru