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:

username=yourwindowsusername
password=yourwindowspassword

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

Volia.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s