sunmingtao / sample-code

3 stars 4 forks source link

Unable to mount samba folder on ubuntu #355

Closed sunmingtao closed 1 month ago

sunmingtao commented 1 month ago

Command

sudo mount -t cifs //192.168.0.1/G /media/xiaomi -o username=smt,password=***

returns

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
sunmingtao commented 1 month ago

Specify SMB Protocol Version

sudo mount -t cifs //192.168.0.1/G /media/xiaomi -o username=smt,password=*****,vers=1.0
sunmingtao commented 1 month ago
sudo nano /etc/samba/user

Contents of /etc/samba/user

username=smt
password=your_password

Make the credential file secure

sudo chmod 600 /etc/samba/user

sudo nano /etc/fstab

Add

//192.168.0.1/G /mnt/network_drive cifs credentials=/etc/samba/user,iocharset=utf8,sec=ntlmssp,vers=1.0 0 0

Finally run sudo mount -a