I would like to connect to a remote machine, ideally over SSH, and then pull the commands from there.
To be precise, I would like make a remote machine connect to my local machine, where I would have an interactive console, send commands and see the output.
Functionally it would be similar to Windows Remote Assistant or what's the name.
I can imagine I would implement a HTTP server that would have a GUI, and on request, it would keep the connection forever and send any line that I type to the GUI; and receive everything the other side sends as its output. I would only have to take care of the HTTP headers. However, that's not too elegant.
Is there some such ready-made solution? Or perhaps using nc
or some tool that would connect the TTY with a listening port?
Best Answer
If you run:
That allows you to do for instance:
locally, to connect and interact with that shell.
Then you can remote-port-forward it over ssh with:
(assumes a relatively recent version of openssh (both client and server)).
And then
user
onhost
can interact with that shell by doing thatInstead of running
$SHELL
, you could runscreen -xRS some-screen-session
to attach a givenscreen
session so several people can see the same screen session.