I have my new servers up and going with Samba and LDAP on them. Now I have to add my users. Here is my problem. I have written a perl script that reads a file and adds users to different groups depending on what grade they are in and it also generates a random password, that it exports to a master list. The old script would add the user to unix and then to samba, along with the password of each user. This made it easy for me to have our student records program to export all of their information and then run it through my perl script. Now that I have switched over to Samba/ldap, I see no option to add the passwd in the command line. It always prompts for the passwd. Does anyone have a way that I can add the user and passwd? The '-P' option in smbldap-useradd does not take a password in-line, but rather asks for it to be typed in. The unix 'passwd' was the same way, but it had a switch '--stdin' so that I could pipe the passwd into it and the smbpasswd actually let you put the password in-line. Thanks for any help. I really do not want to have to enter all of these passwords by hand, and I also do not want them making their own. -- Scott Mayo Technology Coordinator Bloomfield Schools PH: 573-568-5669 FA: 573-568-4565 Pager: 800-264-2535 X2549 Duct tape is like the force, it has a light side and a dark side and it holds the universe together.
Scott Mayo schrieb:> I have my new servers up and going with Samba and LDAP on them. Now I > have to add my users. Here is my problem. I have written a perl script > that reads a file and adds users to different groups depending on what > grade they are in and it also generates a random password, that it > exports to a master list. The old script would add the user to unix and > then to samba, along with the password of each user. This made it easy > for me to have our student records program to export all of their > information and then run it through my perl script. > > Now that I have switched over to Samba/ldap, I see no option to add the > passwd in the command line. It always prompts for the passwd. Does > anyone have a way that I can add the user and passwd? The '-P' option > in smbldap-useradd does not take a password in-line, but rather asks for > it to be typed in. > > The unix 'passwd' was the same way, but it had a switch '--stdin' so > that I could pipe the passwd into it and the smbpasswd actually let you > put the password in-line. > > Thanks for any help. I really do not want to have to enter all of these > passwords by hand, and I also do not want them making their own.Did you see LAM - LDAP Account Manager - http://lam.sf.net ? It's pretty good for managing the domain users, machines, groups etc. You can really fine tune everything there (password expiration, paths, etc.). Give it a try, it's a nice tool. -- Tomek WPKG - automated software installation with Samba http://wpkg.org
ons, 06.07.2005 kl. 22.02 skrev Scott Mayo:> I have my new servers up and going with Samba and LDAP on them. Now I > have to add my users. Here is my problem. I have written a perl script > that reads a file and adds users to different groups depending on what > grade they are in and it also generates a random password, that it > exports to a master list. The old script would add the user to unix and > then to samba, along with the password of each user. This made it easy > for me to have our student records program to export all of their > information and then run it through my perl script. > > Now that I have switched over to Samba/ldap, I see no option to add the > passwd in the command line. It always prompts for the passwd. Does > anyone have a way that I can add the user and passwd? The '-P' option > in smbldap-useradd does not take a password in-line, but rather asks for > it to be typed in. > > The unix 'passwd' was the same way, but it had a switch '--stdin' so > that I could pipe the passwd into it and the smbpasswd actually let you > put the password in-line.How about building smbpasswd into your script? smbpasswd modifies both the Unix and Windows passwords at the same time. Two possible shell solutions, one from Nick Soracco and one from an answer to Wim Bakke (which I don't have), both from this list June last (copy 'n paste): printf "<password>\n<password>\n" | smbpasswd -a -s <username> echo -n -e "$PASS1\n$PASS2" | smbpasswd -as $USERNAME Just read the passwords from your list of details for each pupil.> Thanks for any help. I really do not want to have to enter all of these > passwords by hand, and I also do not want them making their own.It's just that I'm in exactly the same situation as you, with a high school of 750+ pupils, teachers, staff, etc. and everyone in different groups. Best, --Tonni -- mail: tonye@billy.demon.nl http://www.billy.demon.nl