[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = share
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
[share]
comment = Samba server's share
locking = no
writable = yes
browseable = yes
path = /home/share/
valid user = linux
上面设置好之后重启samba服务,(/etc/init.d/smb restart)
然后设置selinux:
确保setlinux关闭,用setenforce 0命令执行。 默认的,SELinux禁止网络上对Samba服务器上的共享目录进行写操作,即使你在smb.conf中允许了这项操作。
getenforce 查看selinux状态为Permissive就行了(具体的selinux设置方式百度吧!)
然后在windows下登陆共享目录,如果仍然么有权限可以将你的用户添加的smb账户中
smbpasswd命令的常用方法
smbpasswd -a 增加用户(要增加的用户必须以是系统用户)
smbpasswd -d 冻结用户,就是这个用户不能在登录了
smbpasswd -e 恢复用户,解冻用户,让冻结的用户可以在使用
smbpasswd -n 把用户的密码设置成空.
要在global中写入 null passwords -true
smbpasswd -x 删除用户
如果添加完仍然不行就修改一下文件的权限,可能是因为你是普通用户登录的但是文件时用超级用户创建的。