How can I establish a reverse ssh tunnel with my ./ssh/config file?I'm trying to reproduce this commandssh -R 55555:localhost:22 user@hostin my .ssh/config file so that when I type ssh host I'll ssh to the host as user and with a reverse tunnel. The commands accepted by the config file are more verbose counterparts to the command line flags. Based on the ssh manpage and the manpage for ssh_config, it seems like the corresponding setting is BindAddress.In my .ssh/config file I have:Host host     Hostname host     User user     BindAddress 55555:localhost:22This, and slight variations of, result in a connection refused when I tryssh localhost -p 55555once logged in on the host. The same works fine if I explicitly give the command at the top when first sshing to the host. My config file does work without the reverse tunnel command; ssh host logs me into host as user.
Reverse ssh tunnel in config
ssh;configuration;ssh tunneling
BindAddress is not the option you're after. From man ssh_config:BindAddress         Use the specified address on the local machine as the source         address of the connection.  Only useful on systems with more than         one address.The configuration file equivalent of -R is RemoteForward:RemoteForward         Specifies that a TCP port on the remote machine be forwarded over         the secure channel to the specified host and port from the local         machine.  The first argument must be [bind_address:]port and the         second argument must be host:hostport. [...]With this information the command linessh -R 55555:localhost:22 user@hosttranslates into the following .ssh/config syntax:Host hostHostName hostUser userRemoteForward 55555 localhost:22