linux 挂载windows 的共享目录操作方法
Linux下挂载windows的共享目录操作方法
第一步:首先在windows系统中新建一个用户名以及设置密码


第二步:Windows中你想要共享的目录要给予新创建的用户读写的权限






第三步:在Linux系统中要先安装cifs
Cifs:是在Linux系统中挂载windows共享目录时要用到的一种文件系统
安装命令:yum -y install cifs-utils*
第四步:在Linux中挂载Windows共享的目录
mount -t cifs //192.168.1.99/LEARN /opt/db/ -o username=LEARN,password=FdAUto.@~#2019,rw,dir_mode=0777,file_mode=0777
其中//192.168.1.99是windows操作系统的IP,LEARN是要挂载的目录
/opt/db是Linux中的挂载点
Username是之前在windows中创建的用户
Password是新建的windows用户的密码
rw,dir_mode=0777,file_mode=0777是设置文件夹的权限
当用以上的命令来挂载的时候,“password=密码”这个参数中
密码:当中不能包括,(逗号)和感叹号(!)这两个特殊字符,否则挂载会报错

如果密码中想用这两个特殊字符,那么可以删除“password=密码”这个参数,如下:
mount -t cifs //192.168.1.99/LEARN /opt/db/ -o username=LEARN,rw,dir_mode=0777,file_mode=0777回车之后会提示我们输入密码这个时候就可以输入带有,和!这两个特殊字符的密码了

第五步:开机自动挂载:
在/etc/fstab中添加红框中的内容

最后
mount -a
确保添加的正确
如果不使用mount -a 验证我们添加是否正确,如果我们添加错误,没有验证,那么Linux重启后会导致无启动系统
相关推荐
-
第18问:MySQL CPU 高了,怎么办?2025-02-24 10:27:18
-
mysql索引类型 normal, unique, full text
mysql索引类型 normal, unique, full text2025-02-24 10:05:05 -
uwsgi+django+nginx 搭建部分总结2025-02-24 10:03:33
-
使用Docker配置Nginx环境部署Nextcloud2025-02-24 10:02:03
-
Nginx安装和怎么使用2025-02-24 10:00:45