Before asking a question:
I can’t use the cpan Net :: SSH module, I want, but I can’t, no amount of beggars will change this fact.
I need to open an SSH connection, open it and read stdout from it and write it to stdin. So far, my approach has been to open it in a pipe, but I could not get past this, it immediately dies.
What I mean, I understand that this leads to a fork. I wrote the code for this fork (or so I think).
Below is the skeleton of what I want, I just need a system to work.
#!/usr/bin/perl use warnings; $| = 1; $pid = open (SSH,"| ssh user\@host"); if(defined($pid)){ if(!$pid){
I know how I look, I'm trying to recreate "system ('ssh user @host"), "this is not my ultimate goal, but knowing how to do this brings me closer to the ultimate goal.
Basically, I need a file descriptor for an open ssh connection, where I can read the output from it and write the input to it (not necessarily directly from my STDIN program, anything, variables, yada yada)
This includes entering a password.
I know about key pairs, part of the ultimate goal involves creating key pairs, but the connection must occur regardless of their existence, and if they do not exist, it is part of my plan to make them exist.