Re: [CentOS] help - batch account creation

2009-08-03 Thread Rajagopal Swaminathan
Greetings, On 8/3/09, David Leon wrote: > Hello guys > > I have a new Centos 5.3 running, and I have a text file with a bunch > of accounts (more than 100) that I should create > . > File format is like this > > user1 pasword1 > user2 passwrd2 > > > How can I do this task easier than creatin

Re: [CentOS] help - batch account creation

2009-08-03 Thread David Leon
thanks, I will try this, it looks like what I'm looking for On 8/3/09, a arias wrote: > Try this: > > while true > do >read username passwd >if [ "$username" == "" ] >then >exit >fi > passwd_hash=$(openssl passwd $passwd) > echo "Using the

Re: [CentOS] help - batch account creation

2009-08-03 Thread David Leon
I found this This command is intended to be used in a large system environment where many accounts are updated at a single time (batch mode). Since username and passwords are stored in clear text format make sure only root can read/write the file. Use chmod command: # touch /root/batch-user-add.

Re: [CentOS] help - batch account creation

2009-08-03 Thread a arias
Try this: while true do read username passwd if [ "$username" == "" ] then exit fi passwd_hash=$(openssl passwd $passwd) echo "Using the following password hash for user "$username": $passwd_hash" /usr/sbin/useradd $username -p "$passwd_hash";

Re: [CentOS] help - batch account creation

2009-08-03 Thread nate
David Leon wrote: > I'm trying to avoid typing every password manually. I just need an > script that makes the job. > > useradd creates the account but still need to setup accpunt's password. > from 'man passwd' --stdin This option is used to indicate that passwd should read

Re: [CentOS] help - batch account creation

2009-08-03 Thread Filipe Brandenburger
Hi, On Mon, Aug 3, 2009 at 14:49, David Leon wrote: > I'm trying to avoid typing every password manually. I just need an > script that makes the job. echo "$password" | passwd --stdin "$username" Obviously, this must be run as root. HTH, Filipe ___ Ce

Re: [CentOS] help - batch account creation

2009-08-03 Thread Dmitry
Use expect/autoexpect + apg tool. Thank you. On 03/08/09 21:49, David Leon wrote: I'm trying to avoid typing every password manually. I just need an script that makes the job. useradd creates the account but still need to setup accpunt's password. On 8/3/09, nate wrote: David Leon wrote

Re: [CentOS] help - batch account creation

2009-08-03 Thread David Leon
I'm trying to avoid typing every password manually. I just need an script that makes the job. useradd creates the account but still need to setup accpunt's password. On 8/3/09, nate wrote: > David Leon wrote: >> Hello guys >> >> I have a new Centos 5.3 running, and I have a text file with a bu

Re: [CentOS] help - batch account creation

2009-08-03 Thread Eduardo Grosclaude
On Mon, Aug 3, 2009 at 3:04 PM, David Leon wrote: > Hello guys > > I have a new Centos 5.3 running, and I have a text file with a bunch > of accounts (more than 100) that I should create > . > File format is like this > > user1 pasword1 > user2 passwrd2 > > > How can I do this task easier than

Re: [CentOS] help - batch account creation

2009-08-03 Thread nate
David Leon wrote: > Hello guys > > I have a new Centos 5.3 running, and I have a text file with a bunch > of accounts (more than 100) that I should create What's the question? How to do it? Parse the text file and use something like useradd to add the accounts, is probably the quickest way. nate

[CentOS] help - batch account creation

2009-08-03 Thread David Leon
Hello guys I have a new Centos 5.3 running, and I have a text file with a bunch of accounts (more than 100) that I should create . File format is like this user1 pasword1 user2 passwrd2 How can I do this task easier than creating user one by one by hand? Need some help for building an scrip