portforwarding - SSH local port forwarding on a remote not listening port: the connection succeeds? -
i discovered today if ssh-forward local port x ssh server port y, , no process listening on port y, can still connect local port x (i don't usual "connection refused" error).
i did test 2 different ssh clients on windows host connecting linux server.
after bit of reflexion, came conclusion pure network point of view, behaviour should expect: ssh client listening on localhost:x, connection possible.
nevertheless, leads problematic situation in have apparently connected socket talks nobody. sending data on socket successful operation.
so question: ssh protocol manage situation in ways, i.e. have strategies detecting situation? , if yes, may hope support feature on ssh clients , apis (today i'm using ssh.net, not seem offer feature).
if not, how proceed detecting situation? timeout on answer?
thanks help, alberto.
the logical behavior close client connection if server can't connect remote side, not better hanging connection.
also there can happen situation when ssh server waiting remote connection minute or 2 before giving up, client's connection opened period of time anyway.
so there's no logical alternative rather hanging client connection.
Comments
Post a Comment