Connecting via SSH to machine without SSH server running OR how to reuse existing ssh conenction reverse

Let's say I have two machines: A and B.

  1. A has installed SSH server and client
  2. B has installed only SSH client
  3. Connection between both machines is working

I know that I can issue following command from machine B:

ssh A

and It will give me the console of machine A.

Is possible to somehow achieve similar but opposite way, get the B console from A?


If machine B has a telnet server running, you can use the ssh connection from B to A to forward the telnet port so that machine A can connect to it even if direct access to the port is blocked by a firewall (as it should be). Assuming telnet is listening on the default port (23) on machine B, you'd do something like ssh -R 23:localhost:2023 A. A user on A could then use telnet localhost 2023 to connect to a shell on B. (We're using port 2023 instead of 23 at the far end because you need to be root to listen on a port number below 1024.)

I don't know of any way to do it without some kind of login server running locally on machine B.


No you can't do that. There should be something running on B that serves the clients.

If the issue is only allowing connection after an initial SSH connection, you can set up a reverse SSH tunnel over the first SSH connection and open new SSH connection over the tunnel. But you still need to run SSH server on B.