Mounting Samba shares persistently during reboot

0 0
0 0

To mount a samba share during each reboot we need to interact manually. This can be automated by putting the samba share entry in fstab which will automatically mount those shares by reading credentials files.

Install with Samba client pacakge

# sudo apt-get install smbfs

fstab entry syntax

//server/share /pathto/mountpoint cifs credentials=/home/username/.smbcredentials,uid=shareuser,gid=sharegroup 0 0

Edit the /etc/fstab and add your entry

//192.168.1.15/public /home/sysadmin/samba cifs credentials=/home/sysadmin/.smbcredentials,uid=sysadmin,gid=sysadmin 0 0

Create the .smbcredentials file in your home directory

username=shareuser
password=sharepassword
domain=domain_or_workgroupname

Make sure to secure the ~/.smbcredentials file by changing the permission to only read by root User.

# chmod 0600 ~/.smbcredentials

Finally, test the mount point by running mount all

# sudo mount -av

Mounting Samba shares persistently during reboot 1

About Post Author

Babin Lonston

Overall 14+ Years of experience in the IT field, currently working as a Senior Linux administration with Virtualization & Cloud. Being numismatist for a long time.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published.

Previous post Install and configure VNC server in CentOS 6, Red Hat 6 & Oracle Linux
Next post Enable setup command in minimal installed Redhat or Centos 6 Linux

Subscribe

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

We promise not to spam you, and we don't usually send more than one email a week.

You have Successfully Subscribed!