RHCSA Rapid Track
Performance Checklist
In this lab, you will install packages to support automounting CIFS shares and create three automounts.
| Resources: | |
|---|---|
| Files: |
samba.txt in each share directory, for testing. |
| Machines: | desktopX and serverX |
Outcomes
Installation of at least two packages to support automounting Samba shares.
Automount
/shares/workwith authenticated,RWaccess to your home directory on serverX.Automount
/shares/docswithROguest access to thepublicshare.Automount
/shares/caseswith authenticated,RWaccess to restricted team sharebakerst.Available persistently after a reboot.
If you haven't already done so at start of the previous exercise:
Reset your serverX system.
Log into and set up your server system.
[student@serverX ~]$lab samba setup
Always perform this step:
Reset your desktopX system.
Log into desktopX and open a terminal.
Your company runs a Samba service on serverX to provide document sharing for both Red Hat Enterprise Linux and Microsoft Windows clients. The server contains a directory for each user to store their personal documents, a publicly available read-only directory for common documents, and a number of team directories to host collaborative documents.
You may need to perform some basic user and group administration on desktopX to ensure
student can access files on all of the shares.
Here are the key details from serverX that you will need:
Username:
studentPassword:
studentGroup membership:
bakerst,GID=10221Domain:
MYGROUPHome shares are enabled and writeable.
desktopX mount point:
/shares/workThere is a share called
publicthat only requires guest privileges to access.desktopX mount point:
/shares/docsYour team has a private, writeable share called
bakerstthat is only accessible to members of thebakerstgroup.desktopX mount point:
/shares/cases
When you are done, reboot your desktopX machine, then run the
command lab samba grade from your desktopX machine to
verify your work.
Install the two packages needed to automount a CIFS file system.
Add an
auto.master.dconfiguration file that identifies the base directory and associated map file (use any name you like for the configuration file, but it must end with.autofs), and create the associated map file (use any name you like for the map file), ensuring proper authentication on each mount. As needed, you can create other configuration files to support the automount mapping configuration.Use vim to create and edit the
/etc/auto.master.d/shares.autofsfile.[student@desktopX ~]$sudo vim /etc/auto.master.d/shares.autofsAdd the following line:
/shares /etc/auto.shares
Note
This solution is using
shares.autofsas the master map file andauto.sharesas the map file, but the file names are not important.Use vim to create the
auto.sharesmap file.[student@desktopX ~]$sudo vim /etc/auto.sharesAdd the following lines:
work -fstype=cifs,credentials=/etc/me.cred ://serverX/student docs -fstype=cifs,guest ://serverX/public cases -fstype=cifs,credentials=/etc/me.cred ://serverX/bakerst
Note
An alternative to the credentials file (and the steps shown here to create and edit it) would be to substitute the
credentials=/etc/me.credentry in theauto.sharesfile with two entries,username=student,password=student, but that would be less secure.Use vim to create the credentials file.
[student@desktopX ~]$sudo vim /etc/me.credAdd the following lines:
username=student password=student domain=MYGROUP
Use chmod to secure the credentials file.
[student@desktopX ~]$sudo chmod 600 /etc/me.credNote
This step is not essential for this lab, but shown for completeness.
Ensure that username
studenthas the correct UID and GIDs to access each of the shares (Hint:bakerst). If necessary, add any new groups that are needed, modify student's group membership, or both.Note: If you add a new group to student's supplementary groups, then you will either need to exit the shell and start a new shell, or use newgrp
groupnameto switch to the newly added group. This is necessary because the environment Bash starts with does not get updated with student's new details.Use the groups command to check the current group memberships for the
studentuser.[student@desktopX ~]$groupsstudentThe
studentaccount does not belong to thebakerstgroup (GID10221) and will need to be added.Check if the
bakerstgroup exists on desktopX. Use grep to check the/etc/groupfile.[student@desktopX ~]$grep -e bakerst -e 10221 /etc/groupThe
bakerstgroup does not exist either; it will need to be added first.Use groupadd to add the
bakerstgroup with GID10221.[student@desktopX ~]$sudo groupadd -g 10221 bakerstUse usermod to add the
bakerstgroup tostudentas a supplementary group.[student@desktopX ~]$sudo usermod -aG bakerst studentNote
This approach is not typically the best solution to align UID and GID values, as there are mount options that can handle this. However, it is a suitable solution for this lab, and you get to practice some user and group administration skills.
Use newgrp to switch to
bakerst.[student@desktopX ~]$newgrp bakerst
Enable and start the automount service.
Check that you can access each share and write to those shares you have write privileges on,
workandcases.There is a file called
samba.txtthat contains the message "Success" in each of the share locations. Usecat samba.txt.Use
echo testing > my.txtto test if you can write to a directory.Check you can read and write in
work:[student@desktopX ~]$cd /shares/work[student@desktopX work]$cat samba.txtSuccess[student@desktopX work]$echo testing > my.txtCheck you can read, but not write, in
docs:[student@desktopX work]$cd ../docs[student@desktopX docs]$cat samba.txtSuccess[student@desktopX docs]$echo testing > my.txtbash: my.txt: Permission deniedCheck you can read and write in
cases:[student@desktopX docs]$cd ../cases[student@desktopX cases]$cat samba.txtSuccess[student@desktopX cases]$echo testing > my.txt
When you are done, reboot your
desktopXmachine, then run the command lab samba grade from yourdesktopXmachine to verify your work.