1.先添加一个linux的用户:
sudo useradd beyondkmp
2.给linux用户设置一个密码:
sudo passwd beyondkmp
3.将beyondkmp加入到smb用户中,并设置smb密码, 也就是登录samba时的密码
smbpasswd -a beyondkmp
4.修改配置文件/etc/samba/smb.conf
[global]
guest account = nobody
netbios name = beyond-laptop
workgroup = WORKGROUP
server string = Samba Server
security = user
encrypt passwords = true
passdb backend = tdbsam #这个就是告诉samba你正在使用什么类型的密码数据库类型,好多网上的资料没有这一句,在我配置中没有这一句就是成功不了
obey pam restrictions = yes
usershare allow guests = yes
load printers = no
log file = /var/log/samba/log.%m
max log size = 50
wins support = yes
dns proxy = no
create mode = 0777
force create mode = 0777
directory mode = 0777
force directory mode = 0777
[beyondkmp]
path = /home/beyond/samba
comment = beyond share file
read only = no
5.重启samba服务,sudo /etc/init.d/samba restart,上图来证明下吧: