RHCSA Rapid Track
In this lab, you will create a mount entry in /etc/fstab and mount
it.
| Resources: | |
|---|---|
| Files: |
samba.txt in the server directory, for testing. |
| Machines: | desktopX and serverX |
Outcomes
cifs-utilspackage installed.The serverX student home folder mounted at
/home/student/work.The
/etc/fstabfile includes the mount entry.
Reset your serverX system.
Log into and set up your server system.
[student@serverX ~]$lab samba setupReset your desktopX system.
Log into desktopX and open a terminal.
You have a home directory on serverX that is used to store work-related documents. The directory is shared via Samba to support all of the company desktop operating systems.
The serverX administrator has confirmed that the share name is student and
that the uid/gid are the same as your desktopX instance; the share password is
student.
Install the Package
Use yum to install
cifs-utils.[student@desktopX ~]$sudo yum -y install cifs-utilsLoaded plugins: langpacks Resolving Dependencies ... Complete!This package provides support for mounting CIFS file systems and is used by the mount command.
Create the Mount Point
Use mkdir to create the
workdirectory mount point.[student@desktopX ~]$mkdir ~/workCreate the Credentials File
Use mkdir to create the
securedirectory.[student@desktopX ~]$sudo mkdir /secureUse vim to create the credentials file
student.smband populate it.[student@desktopX ~]$sudo vim /secure/student.smbAdd the following lines:
username=student password=student domain=MYGROUP
Use chmod to protect the
securedirectory and thestudent.smbcredentials file.[student@desktopX ~]$sudo chmod 770 /secure[student@desktopX ~]$sudo chmod 600 /secure/student.smb
Update /etc/fstab and Mount
Use vim to add the mount settings to the end of
/etc/fstab.[student@desktopX ~]$sudo vim /etc/fstab... //serverX/student /home/student/work cifs credentials=/secure/student.smb 0 0Use mount to verify the settings and mount the file system.
[student@desktopX ~]$sudo mount -aThis command should report no errors. If it does, check your settings in
/etc/fstab.
Check Your Access
Use cat to output the
samba.txtfile.[student@desktopX ~]$cat ~/work/samba.txtSuccessUse echo to write to the
workmount point.[student@desktopX ~]$echo testing > ~/work/test.txt