How to automatically mount windows shares from Linux

Install the samba client

sudo apt-get install smbfs

Create a mountpoint

mkdir ~/mywindowsshare

Create file file called .smbcredentials

with the following content:


protect your password

sudo chmod 600 .smbcredentials

add the following line to /etc/fstab

//windowsservername/sharename /home/username/mywindowsshare smbfs iocharset=utf8,credentials=/home/username/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Try to manually mount the share

sudo mount /home/username/mywindowsshare


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s