搭建Samba服务器
- 安装软件
yum -y install samba system-config-samba samba-client samba-common
- 创建samba账号
groupadd samba
useradd -g samba t440p
# 共享目录
chmod 755/usr/local/nginx/html
chown -R t440p:samba /usr/local/nginx/html
- 创建samba配置文件
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[common]
comment = share
path = /home/share
allow hosts = 192.168.1.1/8
writable = yes
- 测试参数是否正确
testparm
- 为samba用户t440p设置一个密码
smbpasswd -a t440p
- 开放samba服务器端口
UDP 137
UDP 138
TCP 139
TCP 445
Samba服务管理
systemctl start smb.service
systemctl stop smb.service
systemctl enable smb.service
Centos目录映射到windows
-
开启文件共享
-
启用netbios
-
点击【计算机】–>右键–>【映射网络驱动器】–>文件夹位置填写自己centos服务器地址