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

Babin Lonston
Overall 14+ Years of experience in IT field, 7+ years of experience in Linux administration with Virtualization & Cloud technologies. Love documentation and being Numismatics for a long time.

Install and configure VNC server in Centos, RedHat & Oracle Linux

Previous article

Enable setup command in minimal installed Redhat or Centos 6 Linux

Next article

Comments

Leave a reply

Your email address will not be published.