Info - Running on Red Hat Linux release 9 (Shrike), with openssh-3.5p1-6, and perl-5.8.0-88
I am trying to create a Web Password Changer at my work place and I am running into a problem.
I must change the password on two different servers and one of them is the web server running the program. So using Perl and Expect I ssh into server1 (using the person's user id and password) and have no problem changing the password, using the passwd command. The second server (the web server, i will call it server2) is where I am running into problems. Something is going wrong with SSH, Perl, or Expect. Inorder to use the passwd command I must ssh from server2 back into server2 and in the middle of changing the password with the passwd command the program hangs and times out.
I am just spawning a command to ssh into the machine.
my $exp = Expect->spawn("ssh -l $user $server")
or die "Cannot spawn ssh: $!\n";
It is in a function so I am using the exact same code for both servers.
Things I have tried
Running the program from the command line I have moved the program from server2 to server1 and the password is changed on server2 but hangs in the middle of changing the password on server1 (ssh'ing into itself like above).
I have tried running from server2 - ssh into server1 change password and then ssh'ing from server1 back into server2 and the program still hangs in the middle of changing the password.
I have tried extending timeouts to 60 seconds and that doesn't work.
I have uploaded the Program, and the debugging for expect that prints to the screen when the program is running.
Thanks for the help,
Patrick
I am trying to create a Web Password Changer at my work place and I am running into a problem.
I must change the password on two different servers and one of them is the web server running the program. So using Perl and Expect I ssh into server1 (using the person's user id and password) and have no problem changing the password, using the passwd command. The second server (the web server, i will call it server2) is where I am running into problems. Something is going wrong with SSH, Perl, or Expect. Inorder to use the passwd command I must ssh from server2 back into server2 and in the middle of changing the password with the passwd command the program hangs and times out.
I am just spawning a command to ssh into the machine.
my $exp = Expect->spawn("ssh -l $user $server")
or die "Cannot spawn ssh: $!\n";
It is in a function so I am using the exact same code for both servers.
Things I have tried
Running the program from the command line I have moved the program from server2 to server1 and the password is changed on server2 but hangs in the middle of changing the password on server1 (ssh'ing into itself like above).
I have tried running from server2 - ssh into server1 change password and then ssh'ing from server1 back into server2 and the program still hangs in the middle of changing the password.
I have tried extending timeouts to 60 seconds and that doesn't work.
I have uploaded the Program, and the debugging for expect that prints to the screen when the program is running.
Thanks for the help,
Patrick