Script to configure samba share and set password automaticaly

Camilo Vieira camilo.vieira at gmail.com
Mon Feb 17 23:15:10 UTC 2014


Hi Kevin!

Thanks for your help and the following command solve the problem:

(echo backup; echo backup) | sudo smbpasswd -as backup

Thanks!!!!


2014-01-24 17:50 GMT-02:00 Kevin Olbrich <kolbrich at dolphin-it.de>:

> I did not read the whole smbpasswd man page but you can initialize the
> user with "-a username" instead of adding it and then editing the password.
> Just make sure to pipe the password two times, this way you can automate
> the process.
>
> Best regards,
> Kevin Olbrich.
>
> Am 24.01.2014 um 20:46 schrieb Camilo Vieira <camilo.vieira at gmail.com>:
>
> Thanks Kevin! I will try.
> []'s
>
>
> 2014/1/24 Kevin Olbrich <kolbrich at dolphin-it.de>
>
>>
>> Am 24.01.2014 um 20:26 schrieb Camilo Vieira <camilo.vieira at gmail.com>:
>>
>> Hi!
>>
>> I'm working on Ubuntu Server 12.04 preseed instalation for the customers.
>> I have trying to configure a samba share and set the password for the
>> backup user automaticaly.
>>
>> I have added this lines on the post script:
>>
>> # SAMBA SHARE AUTO CONFIGURATION
>>
>> # copy the configuration
>> sudo cp /opt/dgb/smb.conf /etc/samba/
>>
>> # set the password for the backup user
>>
>> sudo mksmbpasswd /etc/passwd > /tmp/samba/smbpasswd
>> sudo mv /tmp/samba/smbpasswd /etc/samba/smbpasswd
>> sudo chown root:root /etc/samba/smbpasswd
>> sudo smbpasswd -a backup -n
>> sudo mkdir /var/backups/nds
>>
>> sudo /etc/init.d/smbd restart
>> ################################
>> Anyone knows how I can set the password using smbpasswd without user
>> intervention?
>>
>> (echo newPassword; echo newPassword) | smbpasswd -s
>>
>> Greetings,
>> Kevin.
>>
>> Thanks!
>>  --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>>
>>
>> --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>>
>>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20140217/65d8bd58/attachment.html>


More information about the ubuntu-users mailing list