in reply to Re: Net::OpenSSH Problem
in thread Net::OpenSSH Problem
Ok I am a bit closer. I know that !bash ran correctly in the remote session because while it was sitting there I typed the pwd and received the correct result. I guess now I am confused as to why the program is waiting on me to interact with it instead of continuing to run the other commands. Current code below
-bash-4.1$ ./test1.pl # open_ex: ['ssh','-O','check','-T','-S','/home/kburns/.libnet-openssh +-perl/kburns-10.10.10.-20023-380016','-l','kburns','10.10.10.1','--'] # _waitpid(20025) => pid: 20025, rc: # open_ex: ['ssh','-S','/home/kburns/.libnet-openssh-perl/kburns-10.10 +.10.-20023-380016','-l','kburns','10.10.10.1','--','!bash']
I typed pwd and it worked so I know !bash ran correctly on the remote end.
pwdmy $ssh = Net::OpenSSH->new($host, user => $USERNAME, password => $PAS +SWORD, str ict_mode => 0); $ssh->error and die "Couldn't establish SSH connection: " . $ssh->erro +r; $ssh->system('!bash') or die "remote command failed: " . $ssh->error; print "!bash done\n"; $ssh->system('pwd') or die "remote command failed: " . $ssh->error; print "pwd done\n"; # never gets here. it hangs
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::OpenSSH Problem
by salva (Canon) on Sep 12, 2013 at 08:15 UTC | |
by kburns1969 (Novice) on Sep 12, 2013 at 16:59 UTC | |
by salva (Canon) on Sep 12, 2013 at 17:18 UTC | |
by kburns1969 (Novice) on Sep 12, 2013 at 17:30 UTC |