[Samba] Using more than one passwd program
Lx
lx at survive-linux.com
Tue Jun 28 08:25:02 GMT 2005
This Programm runs perfectly on Command Line with the parameters i
specified...
But ist still do not get it to run with samba...
Samba doesnt complain or anything...
The script update just zhe passwd section but not the htpasswd...
Could someone tell me why?
here is my smb.conf
<!-- SNIP --->
[global]
server string = %h
netbios name = bfserver001
workgroup = home
wins support = yes
domain master = yes
local master = yes
preferred master = yes
os level = 255
security = user
encrypt passwords = yes
update encrypted = yes
password level = 8
domain logons = yes
logon path = \\bfserver001\profiles\%u
time server = yes
name resolve order = wins host bcast
panic action = /etc/init.d/smb stop
logon script = %u.bat
add user script = /usr/sbin/useradd -d
/dev/null -g 100 -s /bin/false -M %u
add machine script = /usr/sbin/useradd -d
/dev/null -g 100 -s /bin/false -M %u
add user to group script = /usr/sbin/adduser %u %g
delete user from group script = /usr/sbin/deluser %u %g
passwd program = /etc/samba/passchange %u
passwd chat = *New* %n\n *Retype* %n\n
*successfully* *New* %n\n *Re-type* %n\n *Updating*
unix password sync = Yes
username map = /etc/samba/smbusers
passdb backend = smbpasswd
pam password change = yes
map acl inherit = yes
null passwords = no
utmp = yes
writable = no
browsable = no
guest ok = no
write list = lx
interfaces = 10.82.80.0/24,
10.82.85.0/24, 127.0.0.0/24
bind interfaces only = Yes
# Performance Einstellungen
short preserve case = yes
max log size = 5000
case sensitive = no
default case = lower
dead time = 15
read raw = yes
write raw = yes
socket options = TCP_NODELAY
SO_RCVBUF=8192 SO_SNDBUF=8192 IPTOS_LOWDELAY
oplocks = yes
fake oplocks = no
#debug level = 100
preserve case = yes
getwd cache = yes
template homedir = /home/%u/home
template shell = /bin/false
[netlogon]
path = /share/public/netlogon
locking = no
[profiles]
path = /home/%u/profile
writable = yes
create mask = 0600
directory mask = 0700
[homes]
comment = %u's Home-Verzeichniss
path = /home/%u/home
writable = yes
create mask = 0600
directory mask = 0700
[austausch]
path = /share/public/austausch
comment = ACHTUNG Der Inhalt
derAaelter als 5 Tage ist wird automatisch geloescht
writable = yes
guest ok = yes
browsable = yes
<!-- SNAP -->
Lx schrieb:
> Thanks Gemes,
>
> i got it figuered out!!!
>
> here is my script... (for others who seek the same answer)
>
> #!/usr/bin/expect
> #
> # .htpasswd must be initialized by the beginning of the script
> # first run proform a
> # htpasswd -c passwordfile user
>
> set timeout 5
>
> # Setting Variables
> set user [lindex $argv 0]
> set password [lindex $argv 1]
> set htpasswdfile "/etc/samba/.htpasswd"
> set vhtpasswd "/usr/bin/htpasswd"
> set vpasswd "/usr/bin/passwd"
>
>
> # Start passwd
> spawn "$vpasswd" "$user"
> expect "*password:*" {
> sleep 0.5
> send "$password\r"
> }
>
> expect "*password:*" {
> sleep 0.5
> send "$password\r"
> }
>
> # Only if Passwd is succesful start htpasswd
> expect "*passwd:*successfully*" {
>
> spawn "$vhtpasswd" "$htpasswdfile" "$user"
>
> expect "*password:" {
> sleep 0.5
> send "$password\r"
> }
>
> expect "*password:" {
> sleep 0.5
> send "$password\r"
> }
> }
>
>
> expect eof
More information about the samba
mailing list