develooper Front page | perl.beginners | Postings from December 2002

Useradd and Passwd

Thread Next
Kevin Old
December 23, 2002 06:28
Useradd and Passwd
Message ID:
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

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?


Kevin Old <>

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About