Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. SMB_IP=""
  2. SMB_SHARE="" # eg. /Share
  3. MNT_POINT=""
  4. USER=""
  5. PASSWORD="" # escape special characters eg. "P@\$\$W0rd\!"
  6. LOCAL_UID="0"
  7. LOCAL_GID="0"
  8.  
  9. # install
  10. apt-get install cifs-utils
  11.  
  12. # mount freenas samba share on debian 9
  13. mount -t cifs //$SMB_IP$SMB_SHARE $MNT_POINT -o user=$USER,pass=$PASSWORD,vers=3.0,sec=ntlm,file_mode=0775,dir_mode=0775,gid=$LOCAL_GID,uid=$LOCAL_UID
  14.  
  15. # unmount share
  16. umount /mnt/freenas
  17.  
  18. # as fstab entry
  19. # *NOTE* $PASSWORD should not be escaped in fstab
  20. //$SMB_IP$SMB_SHARE $MNT_POINT cifs username=$USER,password=$PASSWORD,vers=3.0,sec=ntlm,file_mode=0775,dir_mode=0775,gid=$LOCAL_GID,uid=$LOCAL_UID 0 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement