安装smb/samba客户端及手工挂载:
apt-get install cifs-utils
mount -t cifs -o user=user,pass=pass,file_mode=0644,dir_mode=0755 //192.168.1.1/share /mnt/
#有的参数不一样并需要指定版本
#mount -t cifs -o username=user,password=pass,iocharset=utf8,vers=3.0 //192.168.1.1/temp /mnt/
修改fstab配置文件开机自动挂载:
cat /etc/fstab
//192.168.1.1/share /mnt cifs user=user,pass=pass 0 0
如果中文乱码先查看编码是否为utf8:
cat /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
#LANG="zh_CN.UTF-8"
#LANGUAGE="zh_CN:zh"
查看是否安装nls_utf8内核模块:
ls /lib/modules/$(uname -r)/kernel/fs/nls/nls_utf8.ko
安装nls_utf8内核模块:
apt install linux-modules-extra-$(uname -r)
还是不行挂载添加指定utf8编码:
iocharset=utf8
参考:
https://askubuntu.com/questions/519796/unable-to-mount-cifs-with-iocharset-utf8