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/a
mount: //10.100.xx/Android is write-protected, mounting read-only
mount: 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/a
mount error(13): Permission denied
Refer 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 /databackup

mount error(127): Key has expired
Refer 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_CHANGE
Sep 26 09:56:05 www kernel: CIFS VFS: Send error in SessSetup = -127
Sep 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 /databackup
mount error(5): Input/output error
Refer 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

链接:https://www.jianshu.com/p/7bbe3f966de1

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值