Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: ssh with IO::Socket::INET

by iburrell (Chaplain)
on Nov 01, 2004 at 17:58 UTC ( [id://404362] : note . print w/replies, xml ) Need Help??


in reply to Re: ssh with IO::Socket::INET
in thread ssh with IO::Socket::INET

If you want the server written in Perl, you will need to write it. Net::SSH::Perl is client only. AFAIK, there is no SSH server implementation in Perl.

There are other solutions. One is to use SSH port forwarding. Your server listens for telnet or plain socket connections on localhost. SSH is used for the authentication and encryption. This forwards port 9000 on the localhost to 127.0.0.1 port 9000 on the remote host. I have used similar commands to foward rdesktop and VNC connections.

ssh -f -N -L 9000:127.0.0.1:9000

An alternative is to make your server into a program that runs on the command line. Then from a normal ssh shell prompt, run your command. You can even have the account automatically run your command.

BTW, if you are really are on 127.0.0.1, there isn't much point in using SSH. The connection isn't going over the network so security isn't a problem.