Mounting Windows SMB share from Debian Wheezy

Configuring an SMB mount from my Linux box to my Windows box. This was helpful.

Basically:

# apt-get install cifs-utils

Then create your credentials file:

# cat > /root/amanda.smbpass  <<EOF
username=jj5
password=SECRET
EOF

Then edit /etc/fstab and add:

//amanda.jj5.net/Users  /media/amanda cifs defaults,noauto,credentials=/root/amanda.smbpass 0 2

Then create /etc/network/if-up.d/mount-amanda like this:

#!/bin/bash
mount /media/amanda

And make sure it’s executable:

# chmod +x /etc/network/if-up.d/mount-amanda

Mounting can also be done from the command-line:

# mount -t cifs -o username=jj5,password=SECRET //amanda.jj5.net/Users /media/amanda