This may be totally late but
First doesn't passwd need "passwd username" not "passwd password"?
Second You could use backticks to execute and pw instead of passwd

print `pw adduser ...`; # man pw for details, you can do tons with pw in just one 
command

If this has already been addressed sorry, I was away.


Dan
-----Original Message-----
From: Kevin Old [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 23, 2002 8:25 AM
To: [EMAIL PROTECTED]
Subject: Useradd and Passwd


Hello all,

I have several users that I need to manage on a few (RH Linux) servers and I have 
recently run into the need to move user lists from one box to another.  I know I can 
copy the passwd and shadow files over from box to box, but I'm not sure that I want to 
move the user and group ID's from box to box.  

I've started to write a script that would take care of some basic user additions.

The part that isnt' working the way I want it is a system command:

system("useradd $username; passwd $pass");

I've also tried: 
system("useradd $username; passwd $pass\n$pass\n$pass\n");

passwd just returns errors that it couldn't add the password.  

Anyone have any ideas what I can use?

Thanks,
Kevin

-- 
Kevin Old <[EMAIL PROTECTED]>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to