Skip to content

Instantly share code, notes, and snippets.

@fire
Created July 22, 2014 08:22
Show Gist options
  • Save fire/1131ac45419eb6cb6dea to your computer and use it in GitHub Desktop.
Save fire/1131ac45419eb6cb6dea to your computer and use it in GitHub Desktop.
MountWindowsSharesPermanently

https://wiki.ubuntu.com/MountWindowsSharesPermanently

 sudo apt-get install cifs-utils
 gedit ~/.smbcredentials

Enter your Windows username and password in the file:

 username=msusername
 password=mspassword

Save the file, exit the editor.

Change the permissions of the file to prevent unwanted access to your credentials:

 chmod 600 ~/.smbcredentials

Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):

 //servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0 

Save the file, exit the editor.

Finally, test the fstab entry by issuing:

 sudo mount -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment