Skip to content

Instantly share code, notes, and snippets.

@TzuChiehHung
Last active May 4, 2021 07:47
Show Gist options
  • Save TzuChiehHung/36c317013d0626e5125b3458956b61bc to your computer and use it in GitHub Desktop.
Save TzuChiehHung/36c317013d0626e5125b3458956b61bc to your computer and use it in GitHub Desktop.
[Auto mount Samba share on Linux] #ubuntu
  • Create .smbcredentials

    username=username
    passowrd=password
    
  • Chage permission to prevent unwanted access

    chmod 600 /path/to/.smbcredentials
    
  • Add following line in /etc/fstab

    //servername/share /path/to/mount/folder cifs auto,user,rw,credentials=/path/to/.smbcredentials,iocharset=utf8,noperm 0 0
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment