What:
Windows and Linux platforms
Problem:
Mount windows share on linux machine via command line
Solution:
mount -t cifs //<server>/share /mnt/dir -ouser=<username>
mount.cifs //<server>/share /mnt/dir -ouser=<username>
To automatically mount on boot, edit /etc/fstab, on Ubuntu first user get's uid=1000, check yours with
echo $UIDWhen share is not secured:
//<server>/share /mnt/dir cifs uid=1000 0 0When share is secured, keep in mind that password is in plain text
//<server>/share /mnt/dir cifs username=,password=,uid=1000 0 0Preferred way is to save username and password in a file and then specify a path with credentials option.
The format of the file /root/.smb-login is:
username=<username>
password=<password>
domain=<domain>
//<server>/share /mnt/dir cifs auto,uid=1000,gid=1000,file_mode=0664,dir_mode=0775, credentials=/root/.smb-login 0 0
No comments:
Post a Comment