I'm trying to write a perl script that ssh's into a bunch of machines from a list, and runs a useradd. I'm having trouble with it.
It seems to be adding the users just fine to the machines in the list, but it keeps printing out 'ssh: root: Name or service not known'.
Also it does useradd on the local machine automaticly, even though i didn't specify it in the list of machines, and prints out 'useradd: user tempuser exists' after the first iteration of the loop. This is probably because it keeps trying to do a useradd on the machine localy every iteration.
Here is the statement that I guess is the root of the problem:
system "ssh root@$machine ; useradd -d /directory/$user $user; exit; "
any help would be much appreciated
-ddanj
It seems to be adding the users just fine to the machines in the list, but it keeps printing out 'ssh: root: Name or service not known'.
Also it does useradd on the local machine automaticly, even though i didn't specify it in the list of machines, and prints out 'useradd: user tempuser exists' after the first iteration of the loop. This is probably because it keeps trying to do a useradd on the machine localy every iteration.
Here is the statement that I guess is the root of the problem:
system "ssh root@$machine ; useradd -d /directory/$user $user; exit; "
any help would be much appreciated
-ddanj