windows主机ip:10.17.128.101
共享文件夹:shared
用户名:nobody
密码:123456
挂载到Linux中的目录/mnt/shared中:
mount -t cifs -o username=nobody,password=123456 //10.17.128.101/shared /mnt/shared
这种命令只是单次的,重启之后会失效,想要开机自动挂载,有两种方法:
第一种:
vi /etc/rc.d/rc.local
在末尾添加:
mount -t cifs -o username=nobody,password=123456 //10.17.128.101/shared /mnt/shared
保存后使之为可执行文件:
chmod +x /etc/rc.d/rc.local
第二种(没验证过):
vi /etc/fstab
在末尾添加:
//10.17.128.101/shared /mnt/shared cifs auto,username=‘nobody’,password=‘123456’ 0 0