enemyofthestate has asked for the wisdom of the Perl Monks concerning the following question:
I am using ssh to start to open a connection to a "service" account on a remote server. The remote account is configured to automatically start a process which reads a few lines (three, right now), processes the information and returns a status. That part works.
On the client side I am testing with:
use IPC:;Open2; my ($childin,$childout,$childerr); my $cmd = qq(/usr/bin/ssh -i $KEYFILE $USER\@$SERVER 2>/dev/null); my $pid = open2 ($childout,$childin,$cmd); my $status = $!; # check for success here # send commands print $childin $line1 print $childin $line2 print $childin $line3 etc...
That works but if there is a "better" way I'd like to know. I tried with Net::SSH::Perl but couldn't get it to work with the remote server starting the command. Maybe I am overlooking something.
The application is intended to allow a user to reset and change his or her Kerberos password from a web interface. The web server does not run on the Authentication Server or KDC.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connecting to STDIN and STDOUT over SSH
by almut (Canon) on Apr 09, 2009 at 20:52 UTC | |
by enemyofthestate (Monk) on Apr 09, 2009 at 23:09 UTC | |
|
Re: Connecting to STDIN and STDOUT over SSH
by ikegami (Patriarch) on Apr 10, 2009 at 03:12 UTC | |
|
Re: Connecting to STDIN and STDOUT over SSH
by salva (Canon) on Apr 13, 2009 at 07:57 UTC |