Hello, does anybody have a idea, how to generate more than 100 Users without having to add them manually or with YaST ? Is there anything like a skript ? The users need the home-dir's too ... ! Thank's ! Best Regards / Mit freundlichen Grüßen Bruno Leonhardt
well of course you could create a script manually which reads and parses an
input file and passes the data to useradd and whatever program you want to
execute ... i don't know whether suse does provide one, but it shouldn't be
too difficult to write such a script.
----- Original Message -----
From:
BLeonhardt@analytek.de wrote:
does anybody have a idea, how to generate more than 100 Users without having to add them manually or with YaST ?
Is there anything like a skript ? The users need the home-dir's too
Other Linux distributions (Debian) use a tool named "adduser" instead of "useradd" (which does make users home-dir with option -m). adduser is better suited for adding many users. Perhaps you can find it somewhere on the net. Kevin -- _ | Kevin Ivory | Tel: +49-551-37000041 |_ |\ | | Service Network GmbH | Fax: +49-551-3700009 ._|ER | \|ET | Bahnhofsallee 1b | mailto:Ivory@SerNet.de Service Network | 37081 Goettingen | http://www.SerNet.de/
* Kevin Ivory (Ivory@SerNet.de) [020403 04:16]:
Other Linux distributions (Debian) use a tool named "adduser"
We have the useradd/userdel programs from the shadow package as well. Just make sure that the new uids are > 500 to avoid problems with updates. -- -ckm
* BLeonhardt@analytek.de wrote on Wed, Apr 03, 2002 at 14:01 +0200:
does anybody have a idea, how to generate more than 100 Users without having to add them manually or with YaST ?
Is there anything like a skript ? The users need the home-dir's too ... !
First, backup /etc/passwd, /etc/shadow, /etc/group :) I would suggest to just create such a script. It's easy. Imagine, you have a file with a line for each user like user1 pass1 user2 pass2 and so on. pass shouldn't have spaces I guess. Call it i.e. new_users. Well, then create a bash script like: #!/bin/bash #This is an untested example while read a b ; do echo -n user: $a useradd -m $USERADDOPTS $a echo "$a:$b" | chpasswd echo " OK" done < new_users USERADDOPTS can carry additionally parameters (try useradd --help). (put the code in a file, chmod +x it, execute it. Feel free to add something. Please check it before using it :). Try it with one or two accounts, adjust it, and finally just use it :)). I don't recommend to edit /etc/passwd or /etc/shadow directly at all. There are already tools build for that that care about security, safeness, races, tmpfiles and so on. It's GNU/Linux, so just use it :) oki, Steffen -- Dieses Schreiben wurde maschinell erstellt, es trägt daher weder Unterschrift noch Siegel.
participants (5)
-
BLeonhardt@analytek.de
-
Christopher Mahmood
-
Kevin Ivory
-
Michael Stern
-
Steffen Dettmer