I'm setting up a server application which requires to establish a secure connection over SSH2, e.g. a client must open SSH2 connection to the server to reach specific application:

% ssh -s -p5000 my.server.com app

I want to understand, what exactly is happening after this command has completed? How client/server know that they have to run over SSH secure channel? Is this called ssh tunneling, or it has different name for it?



The -s flag tells ssh that instead of allocating a tty on the remote computer to use the subsystem specified as the remote command. What you're doing is establishing an ssh session using app as the subsystem similar to how things would work if the remote subsystem were sftp, for example.

| improve this answer | |

All from your question is described pretty well in manual page for ssh(1).


May be used to request invocation of a subsystem on the remote system. Subsystems are a feature of the SSH2 protocol which facilitate the use of SSH as a secure transport for other applications (eg. sftp(1)). The subsystem is specified as the remote command.


-p port

Port to connect to on the remote host. This can be specified on a per-host basis in the configuration file.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.