跨境派

跨境派

跨境派,专注跨境行业新闻资讯、跨境电商知识分享!

当前位置:首页 > 工具系统 > 选词工具 > Centos系列:centos7 共享文件夹配置、使用mount -t cifs 挂载windows共享目录方法与问题解决

Centos系列:centos7 共享文件夹配置、使用mount -t cifs 挂载windows共享目录方法与问题解决

时间:2024-04-27 08:45:15 来源:网络cs 作者:付梓 栏目:选词工具 阅读:

标签: 目录  方法  题解  文件  系列  配置  使用 




一. 共享文件夹配置

1.创建共享文件夹

在这里插入图片描述
在这里插入图片描述
打开CentOS终端,输入命令,查看共享文件夹情况

vmware-hgfsclient

在这里插入图片描述

2.挂载共享目录

在/mnt下创建hgfs文件夹,作为共享目录

sudo mkdir -p /mnt/hgfs

挂载共享目录

sudo gedit  /etc/fstab 

在文件末尾添加

.host:/VM-centos-share /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0

在这里插入图片描述
保存重启即可
如果centos系统因权限无法查看共享文件夹内容

sudo chmod 777 /mnt/hgfs

大功告成!!!

在这里插入图片描述




参考网址: https://blog.csdn.net/u013112749/article/details/109210158 https://blog.csdn.net/JesusMak/article/details/123255910 https://blog.csdn.net/baidu_38300480/article/details/122390855







二. centos7 使用mount -t cifs 挂载windows共享目录方法与问题解决

使用 域\账号 密码 访问 //10.100.xx/Android 的windows 共享

mount -t cifs -o domain=test.com,username=administrator,password=test123 //192.168.1.10/share /usr/local/b
mount -t cifs -o username=scj,password=xxxxx //10.100.xx/09.xx /usr/local/b

报错如下

[root@it519 ~]# mount -t cifs -o username=“domain\xx”,password=“xx” //10.100.xx/Android /usr/local/amount: //10.100.xx/Android is write-protected, mounting read-onlymount: cannot mount //10.100.xx/Android read-only

需要安装cifs-utils

yum install cifs-utils.x86_64

安装完成后继续执行 报错如下

[root@it519 ~]# mount -t cifs -o username=“domain\xx”,password=“xxx” //10.100.xx/Android /usr/local/amount error(13): Permission deniedRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)

原因:命令中关于域的格式不对,正确的是:
建议用这个

mount -t cifs -o domain=test.com,username=administrator,password=test123 //192.168.1.10/share /databackup

mount -t cifs -o username=domain/administrator,password=test123 //192.168.1.10/share /databackup

再次挂载成功

[root@it519 ~]# mount -t cifs -o domain=test.com,username=xx,password=xxx //10.100.xx /Android /usr/local/a

卸载 挂载 umount

[root@it519 ~]# umount -v /usr/local/a/umount: /usr/local/a (//10.100.xxx/Android) unmounted

其他报错

[root@www ~]# mount -t cifs -o username=name,password=123 //192.168.1.10/share /databackupmount error(127): Key has expiredRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)

/var/log/messages内容:

Sep 26 09:56:05 www kernel: Status code returned 0xc0000224 NT_STATUS_PASSWORD_MUST_CHANGESep 26 09:56:05 www kernel: CIFS VFS: Send error in SessSetup = -127Sep 26 09:56:05 www kernel: CIFS VFS: cifs_mount failed w/return code = -127

原因:帐号的密码过期,将windows帐号的密码改为永不过期。

[root@www /]# mount -t cifs -o username=testuser,password=123 //192.168.214.128/npwpw /databackupmount error(5): Input/output errorRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)Sep 26 11:04:18 www kernel: CIFS VFS: cifs_mount failed w/return code = -5

原因:/databackup已经挂载了,需要先umonut,再mount

让linux 启动自动挂载在/etc/fstab中增加

//192.168.1.100/test /media cifs defaults,username=manifold,password=manifolden 0










灞気水笵er

虚拟机安装CentOS7并配置共享文件夹

沈长江

centos7 使用mount -t cifs 挂载windows共享目录方法与问题解决

吾青春、国青春

centos7 使用mount -t cifs 挂载windows共享目录方法与问题解决

本文链接:https://www.kjpai.cn/news/2024-04-27/162749.html,文章来源:网络cs,作者:付梓,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。

文章评论