[Samba] Samba user

Thushara Illangasekara thushara at lankacom.net
Sun Jun 12 23:55:49 MDT 2011


Also You can use "expect" command to do this. This is a sample program I 
used to change unix user passwords. You can edit it to do this job.

#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
sleep 1
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
expect eof



On 06/12/2011 08:53 PM, TAKAHASHI Motonobu wrote:
> From: Jigar Patel<pateljigar.83 at gmail.com>
> Date: Tue, 7 Jun 2011 16:36:28 -0700
>
> (snip)
>> So I have user password into variable so now need to
>> tweak smbpasswd that way that is going to take my variable password instead
>> of asking me. Thanks in advance.
> You can do this like that:
>
> # (echo password; echo password) | smbpasswd -s monyo
> Password changed for user monyo
>
> ---
> TAKAHASHI Motonobu<monyo at monyo.com>  / @damemonyo
>    http://damedame.monyo.com/ / http://facebook.com/monyot
>


More information about the samba mailing list