in reply to a perl program to create two way connection with the server

A SSH connection already is a two-way connection, and it is possible for the server to execute commands on the client - all that needs to be done is the client needs to read the commands from the server and execute them. But maybe you're looking for SSH tunneling (I believe Net::OpenSSH supports this)? It's unclear to me what exactly you want to do, perhaps you could explain or give examples?

  • Comment on Re: a perl program to create two way connection with the server

Replies are listed 'Best First'.
Re^2: a perl program to create two way connection with the server
by irthiza90 (Novice) on Mar 18, 2015 at 13:02 UTC

    say for example i want to reboot the server, is it possible with net::open::ssh

      So is this thread about "two-way connections" or is it a repeat of your last two threads reboot a system (machine or server) multiple times with perl script?

      Anyway, yes, it is possible, given that the user you are connecting to the server with has the permissions to do so (via sudo or directly). A quick, untested copy & paste from the Net::OpenSSH docs, which you should read:

      use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host); $ssh->error and die "Couldn't establish SSH connection: ".$ssh->error; $ssh->system("sudo reboot") or die "remote command failed: ".$ssh->error;
      A reply falls below the community's threshold of quality. You may see it by logging in.
      How is that related to bidirectionality?

      Your questions are unclear. Take your time to fully describe your problem, the environment and what you are trying to achieve and then we may be able to help you.

        hey yes very true am completely unclear on the topic myself. am learning my way through. I will make my questions even more clearer in the coming future