Opening a ssh session and running from some commands on it
I need to SSH from my perl script to a remote machine and then execute some commands in that SSH session.
Please note that i need to automate this process, so i can not supply the password from command line and i don't have the permission to install Net::SSH::Perl on my machine, i need to stick to basic perl. Moreover, i can not even use the SSH-KEYGEN to copy the key on remote machine because of perlission, so i have to give the password only, i don't know how. Supplying the password is one part of the problem. Another part of the problem is executing commands in that SSH session and getting their output.
As per the standard stuff, i should be able use the following syntax for SSH:
ssh username IP <command>
But my remote machine is not a STANDARD unix machine and hence i can not execute the command like this in one step.
I need to SSH to this server and then execute the command as a second step.
Please suggest, i really need to know how to open the SSH session from perl, pass the password to it automatically and then executing any commands on it.
Thanks in advance