一. 共享文件夾配置
1.創(chuàng)建共享文件夾
打開CentOS終端,輸入命令,查看共享文件夾情況
vmware-hgfsclient
2.掛載共享目錄
在/mnt下創(chuàng)建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系統(tǒng)因權(quán)限無法查看共享文件夾內(nèi)容
sudo chmod 777 /mnt/hgfs
大功告成?。?!
參考網(wǎng)址: 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/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
安裝完成后繼續(xù)執(zhí)行 報錯如下
[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)
原因:命令中關(guān)于域的格式不對,正確的是:
建議用這個
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內(nèi)容:
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已經(jīng)掛載了,需要先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共享目錄方法與問題解決文章來源地址http://www.zghlxwxcb.cn/news/detail-785308.html
吾青春、國青春文章來源:http://www.zghlxwxcb.cn/news/detail-785308.html
centos7 使用mount -t cifs 掛載windows共享目錄方法與問題解決
到了這里,關(guān)于Centos系列:centos7 共享文件夾配置、使用mount -t cifs 掛載windows共享目錄方法與問題解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!