Linux 挂载 windows共享盘

来源:互联网 发布:优化教育环境 编辑:程序博客网 时间:2024/05/18 20:34

windows电脑IP地址:192.168.1.10, windows共享文件夹的共享名 share, windows开机账号密码: username/password

在Linux服务器上用命令挂载:

mount -t cifs -o username=username,password="password" //192.168.1.10/share /mnt

查看是否已挂载

df -h

查看挂载情况

mount -l

cd到/mnt文件夹,ls -ltr便可以查看windows共享盘里面的文件了

cd /mnt

ls -ltr


要删除挂载盘的时候用命令umount /mnt

如果遇到出错提示umount: /mnt: device is busy,退出所有调用该挂载盘的程序,再删除


设置开机挂载,自动加载

vi /etc/rc.local,加入

mount -t cifs -o username=username,password="password" //192.168.1.10/share /mnt


密码有特殊符号报错:-bash: !": event not found

解决方法:尝试把密码外面的双引号改成单引号,问题解决,挂载成功

mount -t cifs -o username=username,password='password!' //192.168.1.10/share /mnt








0 0