一、前导说明
经常有学员询问如何将centos\ubuntu目录映射到windows中以方便开发工作,因此写这个指导博客方便大家配置开发环境。
将linux系统目录映射到windows有多种方法
- samba
- nfs
- ftp
- ...
【本栗采用samba方式实现】
二、配置过程
1. 安装samba组件
# yum install samba samba-clinet -y
2. 修改samba配置文件
#cd /etc/samba/
#mv smb.conf smb.conf.bak
#vi smb.conf
内容如下
[global]
workgroup = SAMBA
netbios name = 172.16.100.1
server string = samba server
log file = /var/log/samba/log%m
max log size = 50
security = user
map to guest = Bad User
[share]
comment = sharee source
path = /share
writable = yes
browseable = yes
guest ok = yes
- netbios name=172.16.100.1为当前服务器的IP地址
3.创建共享目录和权限
# mkdir /share
# chmod 777 /share
# touch /share/test.file
4.关闭安全策略
# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g‘ /etc/selinux/config
# setenforce 0
# systemctl stop firewalld
# systemctl disable firewalld
5.启动服务
# systemctl restart smb nmb
# systemctl enable smb nmb
三、windows使用共享目录
1.访问测试
2.映射磁盘
结果
原文地址:https://blog.51cto.com/54dev/2466220
时间: 2024-11-08 01:21:22