您的位置:首页 > 运维架构 > Linux

windows 10 共享目录给Linux系统(VMware)

2019-03-22 15:26 330 查看

经过了不断的排错和解决问题,终于成功的挂载了共享目录

[code][root@guowei ~]# df -Th
Filesystem                 Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root      xfs        17G  3.3G   14G  20% /
...
//192.168.142.1/linuxshare cifs      500G   55G  446G  11% /mnt/windows

确保windows 可以和 linux互通

windos系统

[code]C:\Users\11409>ipconfig

Windows IP 配置
...
以太网适配器 VMware Network Adapter VMnet1:

连接特定的 DNS 后缀 . . . . . . . :
本地链接 IPv6 地址. . . . . . . . : fe80::1e0:9535:d3ed:165e%25
IPv4 地址 . . . . . . . . . . . . : 192.168.142.1
子网掩码  . . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . :
...

C:\Users\11409>ping 192.168.142.129

正在 Ping 192.168.142.129 具有 32 字节的数据:
来自 192.168.142.129 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.142.129 的回复: 字节=32 时间<1ms TTL=64

192.168.142.129 的 Ping 统计信息:
数据包: 已发送 = 2,已接收 = 2,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
Control-C
^C

Linux系统

[code][root@guowei ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
inet 192.168.142.129  netmask 255.255.255.0  broadcast 192.168.142.255
inet6 fe80::700e:9a3e:a62c:d8fb  prefixlen 64  scopeid 0x20<link>
ether 00:0c:29:bd:a3:76  txqueuelen 1000  (Ethernet)
...
[root@guowei ~]# ping 192.168.142.1
PING 192.168.142.1 (192.168.142.1) 56(84) bytes of data.
64 bytes from 192.168.142.1: icmp_seq=1 ttl=64 time=0.442 ms
64 bytes from 192.168.142.1: icmp_seq=2 ttl=64 time=0.687 ms
^C
--- 192.168.142.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.442/0.564/0.687/0.124 ms

windos主机配置

新建共享文件 

修改文件linuxshare权限

右键点击文件——属性——共享——高级共享

共享此文件夹——添加“权限”——选择Everyone(或者其他的用户名均可以)——开放“允许”权限——确定

回到“属性”这一界面——选择“密码保护“中的网络和共享中心”

修改如下属性:

展开“所有网络”——修改“密码保护的共享”——选择“关闭密码保护的共享”

 

注:一定程度可以解决这个问题“Permission denied”

[code][root@guowei windows]# mount.cifs //192.168.142.1/linuxshare  /mnt/windows/
Password for root@//192.168.142.1/linuxshare:  ******
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

常见问题:

无法访问或者其他问题:

修改网络安全设置 : 开始——运行 gpedit.msc , 打开组策略 ——计算机配置——Windows设置——安全设置 —— 本地策略——安全选项—— 选择 “网络安全 : LAN 管理器身份验证级别” , 双击打开 , 设置成“发送 LM 和 NTLM 响应” 以及选择 “网络访问:本地帐户的共享和安全模型” , 修改为使用经典模式 ;
 

报错如下

[code][root@guowei windows]# smbclient -L //192.168.142.1
protocol negotiation failed: NT_STATUS_CONNECTION_RESET

开始——控制面板——程序——程序和功能——启用或关闭windows功能——开启SMB 1.0/CIFS 文件共享支持——确定——重启

Linux系统

安装cifs-utils.x86_64

[code][root@guowei ~]# yum -y install cifs-utils.x86_64

挂载

[code]mount.cifs //192.168.142.1/linuxshare  /mnt/windows/

查看

[code][root@guowei ~]# ls /mnt/windows/
desktop.ini

验证:

[code][root@guowei ~]# touch linux.txt
[root@guowei ~]# ls /mnt/windows/
desktop.ini   linux.txt

在windows 查看

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: