Linux – mount remote windows drivers

Temporary solution:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharset=utf8,file_mode=0777,dir_mode=0777

Permanent solution:

touch /root/.smbcredentials
chmod 700 /root/.smbcredentials
echo 'username=winusername
password=winpassword' > /root/.smbcredentials
vim /etc/fstab
#add this:
//netbiosname/sharename    /media/sharename        cifs    credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
//netbiosname/sharename    /media/sharename        cifs    guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
//netbiosname/sharename    /media/sharename        cifs    guest,iocharset=utf8 0 0
#mount without reboot
mount -a

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*