Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: b1ackmai1er on April 18, 2011, 06:41:45 AM

Title: chpasswd for samba
Post by: b1ackmai1er on April 18, 2011, 06:41:45 AM
Is it possible to have a chpasswd for samba. i.e chsmbpasswd so we can change samba passwords in batch files

thanks
Title: Re: chpasswd for samba
Post by: curaga on April 18, 2011, 08:19:59 AM
http://syslog.warten.de/verbose/2010/05/chsmbpasswd.html :P
Title: Re: chpasswd for samba
Post by: danielibarnes on April 18, 2011, 12:10:13 PM
http://syslog.warten.de/verbose/2010/05/chsmbpasswd.html :P

That script was a bit primitive, here is a smaller equivalent:
while read x; do u=${x%:*}; p=${x#*:}; echo $p$'\n'$p|smbpasswd -s -a $u; done
Title: Re: chpasswd for samba
Post by: b1ackmai1er on April 19, 2011, 08:24:40 AM
Thanks guys!

Thats so cool.
Title: Re: chpasswd for samba
Post by: b1ackmai1er on April 19, 2011, 09:10:53 AM
Hi Again,

for simplicity, is there a way of doing this inline?

Thanks
Title: Re: chpasswd for samba
Post by: danielibarnes on April 20, 2011, 03:36:06 PM
Hi Again,

for simplicity, is there a way of doing this inline?

Thanks

What do you mean, "inline?" You can save it as a script, say /usr/local/bin/chsmbpasswd, and make it executable with chmod +x chsmbpasswd.