samba srver on centos-7
切换到root用户安装samba,将windows登录用户admin映射到linux用户centos
安装samba并准备工作目录
yum install -y samba samba-client
mkdir -p /var/samba/code
chown -R centos:centos /var/samba/code
touch /etc/samba/smbusers
echo "centos = admin " >> /etc/samba/smbusers
编辑 /etc/samba/smb.conf:
[global]
workgroup = WORKGROUP
server string = samba server %v
netbios name = centos7
security = user
username map = /etc/samba/smbusers
encrypt passwords = true
passdb backend = smbpasswd
smb passwd file =/etc/samba/smbpasswd
dns proxy = no
log file = /var/log/samba/log.%m
max open files = 1000
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
[code]
comment = SHAREDOCS
path = /var/samba/code
writable = yes
browseable = yes
available = yes
设置windows登录用户admin的密码:
smbpasswd -a centos
重启服务:
systemctl restart smb
systemctl enable smb
systemctl status smb