NFS and Samba are both used commonly as file-sharing solutions between Linux servers. In this lab, you’ll learn to configure a Samba server and a file share. You’ll then create a Samba user. Next, you’ll configure a Samba client and mount the file system from the server to the client.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Install Samba, Add a User, Create a Directory, Check selinux Status, and Set File System Context
- Install the Samba package.
- Start the Samba service.
- Enable the Samba Service.
- Add the
smbuser1
user to the system. - Set the password for user
smbuser1
. - Create a directory named
/smbuser1
. - Change the permissions to read, write, execute on
/smbuser1
. - Check the status of
selinux
. - If running, set the context of
/smbuser1
tosamba_share_t
.
- Edit the Samba Configuration and Add a Share, Test the Configuration, and Restart the Samba Service
- Configure a Samba share named
/smbuser1
with read and write access for usersmbuser1
. - Test the configuration file for syntax errors.
- Restart the Samba service.
- Get the Samba server system IP address.
- Configure a Samba share named
- On the Client Server, Install the CIFS package, Configure a Persistent Mount, and Test the File System
- Install the CIFS utilities package.
- Create the mount point,
/mnt/smbuser1
. - Grant read, write, and execute permissions on
/smbuser1
. - Configure
/mnt/smbuser1
to mount persistently onServer2
. - Configure a credentials file for mount authentication.
- Mount the file system.
- Verify the file system is mounted and has read and write access.
- Mount -a