Hi, I'm using samba-3.0.28-0.fc8. I'm trying to build a file server for 100 users. I created a perl script that automatically adds the 100 users plus their passwords with success. Now I'm having difficulty creating a script using the smbpasswd command because passwords must be entered in stdin. I also tried smbpasswd -s option but it asks passwd in stdin. Is there a way that I can use the command smbpasswd plus the user password in one line? Also, I read about mksmbpasswd.sh and test it but it did not work at all. My smb.conf contains: smb passwd file = /etc/samba/sambapassword and did: cat /etc/passwd | grep test | /usr/bin/mksmbpasswd.sh > /etc/samba/sambapassword Is there a way for me to sync the userpassword and smbpasswd? Help me please. -Iris Lames
Iris Lames wrote:> Hi, > > I'm using samba-3.0.28-0.fc8. I'm trying to build a file server for 100 > users. I created a perl script that automatically adds the 100 users plus > their passwords with success. Now I'm having difficulty creating a script > using the smbpasswd command because passwords must be entered in stdin. I > also tried smbpasswd -s option but it asks passwd in stdin. Is there a way > that I can use the command smbpasswd plus the user password in one line? > > Also, I read about mksmbpasswd.sh and test it but it did not work at all. > My smb.conf contains: > smb passwd file = /etc/samba/sambapassword > and did: > cat /etc/passwd | grep test | /usr/bin/mksmbpasswd.sh > > /etc/samba/sambapassword > > > Is there a way for me to sync the userpassword and smbpasswd? Help me > please. > > -Iris Lames >Is PAM a viable option in your current environment? Chapter 28. PAM-Based Distributed Authentication <http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/pam.html>
Iris Lames wrote:> Hi, > > I'm using samba-3.0.28-0.fc8. I'm trying to build a file server for 100 > users. I created a perl script that automatically adds the 100 users plus > their passwords with success. Now I'm having difficulty creating a script > using the smbpasswd command because passwords must be entered in stdin. I > also tried smbpasswd -s option but it asks passwd in stdin. Is there a way > that I can use the command smbpasswd plus the user password in one line?You will be able to knock something up using expect. http://expect.nist.gov/ There may be a better way, but that will work
Iris Lames escreveu:> Hi, > > I'm using samba-3.0.28-0.fc8. I'm trying to build a file server for 100 > users. I created a perl script that automatically adds the 100 users plus > their passwords with success. Now I'm having difficulty creating a script > using the smbpasswd command because passwords must be entered in stdin. I > also tried smbpasswd -s option but it asks passwd in stdin. Is there a way > that I can use the command smbpasswd plus the user password in one line? >As already answered by other people, you can use expect, I use it to set initial passwords, feeding smbldap-passwd in automated installs, it works and is the only solution that I know about too.> Also, I read about mksmbpasswd.sh and test it but it did not work at all. > My smb.conf contains: > smb passwd file = /etc/samba/sambapassword > and did: > cat /etc/passwd | grep test | /usr/bin/mksmbpasswd.sh > > /etc/samba/sambapassword >What do you mean by did not work at all? Have you sure that you are executing it in the right place? Theres nothing wrong with that line unless mksmbpasswd isn't where you think it is (isn't it in sbin?) or isn't working as it should (not likely).> Is there a way for me to sync the userpassword and smbpasswd? Help me > please. > > -Iris Lames >I don't know if I got it right. Doing what you are trying to do will just INITIALLY create the same accounts in samba as in /etc/passwd without setting the passwords (I don't know Fedora, but Debian based distros does that by default in the package scripts if the user choose to). Debian can convert it to tdbsam after that too. All that can be scripted. If by "sync" you mean initially populate smbpasswd as you are trying to do, the easiest way is already this way. Any other way you will redoing the mksmbpasswd script. Regards. Edmundo Valle Neto