要实现 windows 访问 虚拟机下的linux 需要安装 samab 服务
-----1
安装 samba yum install samba
然后 修改 samba的配置文件 gedit /etc/samba/smb.conf
修改 工作组
//------以下是配置文件的一部分----------------//
# can set it to SMB2 if you want experimental SMB2 support.
#
workgroup = WORKGROUP(你windos 计算机的工作组)
server string = Samba Server Version %v
然后修改 允许通过的IP
netbios name = MYSERVER
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
; hosts allow = 127. 192.168.12. 192.168.13. 192.168.1.
注意IP的格式
security = share #访问的方式,share不需要密码,user需要用户名和密码,可以根据自己需要更改
配置 文件路径
"staff" group (which have write permissions):
; [public]
; comment = Public Stuff
; path = /home/smb
; public = yes
; writable = yes
; printable = no
; write list = +staff
然后保存。
smbpasswd -a root #root为用户名,然后再输入两次密码
然后 重启samba---systemctl restart smb.service nmb.service
开机启动 chkconfig smb on
安装 iptable(防火墙服务我的版本是没有 的)
yum install iptables-services
然后重启 防火墙 关闭防火墙 systemctl restart iptables.service
关闭 selinux命令 setenforce 0
最后 在windos 输入 \\192.168.xxx.xxx你的ip便可以访问