[Samba] Adding samba users via a script

Mi mi.lists at alma.ch
Sun Jul 17 11:30:56 GMT 2005


>The script works by reading the user's name, password and group from a text 
>file, first generating Unix user accounts and then running:
>
>/usr/bin/smbpasswd -a -s $user $pwd > /dev/null
>
>to add the smb accounts. The -s switch should allow the Samba password to 
>pulled from stdin instead of a prompt but the scipt just exits at the point 
>of attempting the creation of the first Samba account . Is there any 
>difference between Samba 2 and Samba 3 that would explain this?
>
This seems to work for me:

echo -e "$password\n$password" | smbpasswd -a -s $user && echo OK SMB




More information about the samba mailing list