切换到root用户安装samba,将windows登录用户admin映射到linux用户centos
安装samba并准备工作目录
yum install -y samba samba-client mkdir -p /var/samba/code
chown -R centos:centos /var/samba/codetouch /etc/samba/smbusersecho "centos = admin " >> /etc/samba/smbusers
编辑 /etc/samba/smb.conf:
[global]workgroup = WORKGROUPserver string = samba server %vnetbios name = centos7security = userusername map = /etc/samba/smbusersencrypt passwords = truepassdb backend = smbpasswdsmb passwd file =/etc/samba/smbpasswddns proxy = nolog file = /var/log/samba/log.%mmax open files = 1000socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
[code]comment = SHAREDOCSpath = /var/samba/codewritable = yesbrowseable = yesavailable = yes
设置windows登录用户admin的密码:
smbpasswd -a centos
重启服务:
systemctl restart smb
systemctl enable smb
systemctl status smb