Mount CIFS/SMB-Share static on Linux

This quick guide shows how to mount a CIFS/SMB-Share across over reboots on Debian-based installations.

1. Install the package cifs-utils:

sudo apt install cifs-utils

2. Append this to your /etc/fstab file:

//<path-to-share> <path-to-mountpoint> cifs credentials=/root/smbcredentials,uid=1000 0 0

3. Store your login credentials under /root/smbcredentials, therefore create this file and insert this:

domain=<domain> username=<username> password=<password>

If not using domain authentication just remove the domain line. domain should be the NetBIOS-Name of your domain. Password and username must be without ' at beginning and end.

4. Mount your share manually or reboot your system:

sudo mount -a

Now your share will be mounted across reboots!