Post

Automatically mount SMB / CIFS / Windows share on Debian at startup

As root user, create a credentials file.
Note that and should be entered without “<>” brackets. root@Erebus:~# cat > .smbcredentials username= password=

Add a line to your /etc/fstab:
Specify the local machine username which you will access the share as
/// cifs uid=,credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

In my case it looks like this:
//192.168.2.200/DATA /media/BIGBOX1 cifs uid=jonas,credentials=/root/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

If things don’t work, try mounting the share manually first. Also, ensure that cifs-utils is installed.

This post is licensed under CC BY 4.0 by the author.