User Tools

Site Tools


ubuntu:samba:mount_a_windows_share

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:samba:mount_a_windows_share [2019/12/08 20:40] peterubuntu:samba:mount_a_windows_share [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 18: Line 18:
 mount -t cifs -o username=USERNAME,password=PASSWD //192.168.1.88/shares /mnt/share mount -t cifs -o username=USERNAME,password=PASSWD //192.168.1.88/shares /mnt/share
 </code> </code>
 +
  
 ---- ----
Line 27: Line 28:
 <code bash> <code bash>
 mount -t cifs -o username=USERNAME,password=PASSWD,iocharset=utf8,file_mode=0777,dir_mode=0777 //192.168.1.88/shares /mnt/share mount -t cifs -o username=USERNAME,password=PASSWD,iocharset=utf8,file_mode=0777,dir_mode=0777 //192.168.1.88/shares /mnt/share
- 
-sudo mount -t cifs -o username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g),forceuid,forcegid, //server-address/folder /mount/path/on/ubuntu 
 </code> </code>
  
Line 69: Line 68:
  
 </WRAP> </WRAP>
 +
 +----
 +
 +
 +<code bash>
 +sudo mount -t cifs -o username=${USER},password=${PASSWORD},uid=$(id -u),gid=$(id -g),forceuid,forcegid, //server-address/folder /mount/path/on/ubuntu
 +</code>
 +
  
 ---- ----
Line 117: Line 124:
 ** NOTE:** If the system complains add the 'noauto' parameter. ** NOTE:** If the system complains add the 'noauto' parameter.
 </WRAP> </WRAP>
 +
 +----
 +
 +=== Mount the shares ===
 +
 +<code bash>
 +sudo mount -a
 +</code>
 +
 +or Reboot.
  
 ---- ----
Line 150: Line 167:
  
 </WRAP> </WRAP>
 +
 ---- ----
  
-==== Mount the shares ====+===== Extende fstab to assign full permissions to newly created files and directories ===== 
 + 
 +Add these lines to /etc/smb.conf on the server: 
 + 
 +<file bash /etc/smb.conf> 
 +... 
 +create mask 0666 
 +force create mode 0666 
 +directory mask 0777 
 +force directory mode 0777 
 +... 
 +</file> 
 + 
 +This gives 0777 permission to every samba users in the write list for new created directory or files. 
 + 
 +---- 
 + 
 +===== Hide Credentials ===== 
 + 
 +Setup a credentials file so you don't need to enter your password in the command; causing it to be stored in your command history in plain-text) or at the prompt (a nuisance).
  
 <code bash> <code bash>
-sudo mount -a+sudo mount -t cifs //nas/docs /media/peter/nas_docs -o vers=3.11,credentials=/home/peter/.ssh/.smb_nas
 </code> </code>
 +
 +Note the **credentials option**
 +
 +<file bash /home/peter/.ssh/.smb_nas>
 +username=peter
 +password=[REAL PASSWORD]
 +domain=WORKGROUP
 +</file>
  
ubuntu/samba/mount_a_windows_share.1575837642.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki