-   Debian (
-   -   adding 276 users (

k1e0x 07-11-2003 09:26 PM

adding 276 users
Ok I was able to convince my staff to replace there old exchange server with a Debian mail server. I have it up and running now and all is well, however I still need to add alot of users to the system before we switch over. I have now a execell spreadsheat that looks somewhat like this.

user1 pass1
user2 pass2

if I export that to a txt file. what is the easiest way to add those to the system? perl script maybe? is there a speical "Debian" way to go about it? what about adding user quotas, should I even worry about quotas?

thanks in advance.

isme 07-12-2003 10:34 AM

you can make a shellscript to create the accounts.
here are some hints:

addgroup $user : to add the group
useradd -d /home/$user -g $user -m $user : to add the users, create home directories etc.
echo "$user:$password" | chpasswd : to make the passwords.

Of course, you need to script this a littlebit, to read $user and $password from your txt file.

Hope, that helps.

k1e0x 07-12-2003 01:21 PM

yeah, thats likley what ill do. I was just wondering if there was a more Debian centric approach to it, like kernel-package or the pentium-builder types of packages..

or better yet sync it to a active directory server, that would be my ultimate solution.

k1e0x 08-07-2003 04:29 PM

here is the script I used to do this, I thought I would share it so other people didn't have to go through the trouble I did making it.

(the forum may eat the script's syntax)

# addusers script to be used on a SQL user database
# works with windows carrage returns ("^M")
# password,Lastname,Firstname

for $line (<>) {

# get password

# get lastname

# get firstname


# build bash command
#system "bash command";

print "\nDone!\n";

All times are GMT -5. The time now is 05:28 PM.