Home Linux Samba network share automatic mount

Samba network share automatic mount


Samba is a free software re-implementation of the SMB/CIFS networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients. Samba runs on most Unix, OpenVMS and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple’s macOS Server, and macOS client (Mac OS X 10.2 and greater). Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well.

Now let’s see that we how can mount such drives on Ubuntu or Mint as you automatically turn on your computer.

We need install cif-utils (even if you already have Samba and related packages installed):

Edit the fstab file:

Add your entry:

Ubuntu 17.10:

Create the .smbcredentials file in your home directory:

Add your entry:

Make sure you secure your ~/.smbcredentials file:

Finally, test the mount with:

Now, when you turn on the computer, the selected network drives are automounted.