Synology : Mount permanently SMB shares

1. Keep your credentials safe

Create a file for your credentials in your home folder :

touch ~/.smbcredentials

Keep it private :

chmod 600 ~/.smbcredentials

Then fill it :

vi ~/.smbcredentials

Using the following content :

username=myUsername
password=myPassword

2. Permanent mount

Edit your fstab :

sudo vim /etc/fstab

And fill it with the following :

//X.X.X.X/MySharedFolder    /media/MyMountPoint  cifs credentials=/home/MyUnixUsername/.smbcredentials,iocharset=utf8

Then you can try to mount it :

sudo mount -a

And then checked that this is mounted :

mount

Note, you could have this issue :

mount: wrong fs type, bad option, bad superblock on ...
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount. helper program)

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

In this case, you should just install cifs-utils :

sudo apt-get install cifs-utils

You should have something like this :

//192.168.1.3/public on /media/public type cifs (rw,relatime,vers=1.0,sec=ntlm,cache=strict,username=ron,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.3,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

Leave a Reply

Your email address will not be published. Required fields are marked *