Hi list For a project we are trying to change the samba password automatically in a cron job. Since smbpasswd doesn't allow the password to be entered otherwise than though the console (user input). We found a solution to the input part though expect. But as thing go expect doesn't work in a cron job since it has no tty. Is there anyone who can point us the right way to a solution. Thanks in advance. Dennis
Dennis Duggen wrote:> Hi list > > For a project we are trying to change the samba password automatically > in a cron job. Since smbpasswd doesn't allow the password to be entered > otherwise than though the console (user input). We found a solution to > the input part though expect. But as thing go expect doesn't work in a > cron job since it has no tty. > > Is there anyone who can point us the right way to a solution.Hi, I also had a similar problem with providing a password to cupsaddsmb. You might try running your expect script through screen (although I solved the cupsaddsmb problem differently). -- Tomasz Chmielewski Software deployment with Samba http://wpkg.org
Try
echo -e "${PASSWD}\n${PASSWD}" | smbpasswd -a -s ${USER}
br,
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url :
http://lists.samba.org/archive/samba/attachments/20060221/88e4c319/attachment.bin