[Ssh-sftp-perl-users] how to achieve net::telnet like functionality with ssh (sit at a remote shell
Brought to you by:
dbrobins
From: John D. <Joh...@in...> - 2004-02-22 22:52:28
|
I'm trying to replace Net::Telnet with Net::SSH::Perl. I want to open a connection with a pty to a remote box (where the login user executes .profile and starts a legacy DB shell) and let it sit there. Then I simply want to be able to run command after command without re-authenticating. This part is in a socket accept loop and implements a clunky kind of pool of telnet sessions to an arcane DB (no DBI or anything to use). When I ssh->login(), channel 0 starts the shell and sits there, but each ssh->cmd() seems to start over at the ksh or bash or whatever. I can get him to work but only by restarting the DB shell as command with the real DB command as his STDIN (which defeats the purpose of my pool). So, the questions: 1) Can I get channel 0 to do my bidding? 2) - or - Can I suppress multiplexing? 3) - or - Can I somehow use ssh->shell programmatically? It could be that I am simply asking for things not supported by SSH and probably belong in the world of Net::Telnet but any advice would be greatly appreciated! The other thing I tried was ssh->shell but could not seem to defeat his attachment to my STDIN (or write to STDIN behind the scenes). Thanks in advance for any suggestions. John ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------- This e-mail and any attachments thereto are intended only for use by the addressee(s) named herein and may contain proprietary and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify Pos...@IN... and permanently delete the original, any attachments, any copies thereof, and any printouts thereof. |