I have to connect to a base server, call it server1, and the from there, I can access many other servers (host1, host2, ...host99.) I have the autossh working for server1 with no problems - it restores my connection to server1 anytime my network connection is lost. However, staying connected to server1 is not my only goal. I want to stay connected to host1, 2, etc. when I'm using those machines.
I just use this to get to server1:
autossh server1
Right now, when I try to autossh to host1, I get:
local autossh[867] <Error>: bind on 127.0.0.1:12346: Address already in use
Now, the setting for my monitoring port is just 12345 (in ~/.bash_profile):
export AUTOSSH_PORT=12345
...so it looks like the localhost port 12346 is tried next but fails.
My ~.ssh/config has this forwarding setup:
Host server1
User jacob
HostName server1.mydomain.com
Port 722
ForwardAgent yes
LocalForward 1124 1:22
RemoteForward 52698 127.0.0.1:52698 #for sublime text / rmate
IdentityFile ~/.ssh/id_rsa
Host host1
User jacob
HostName localhost
RemoteForward 52698 127.0.0.1:52698
Port 1124
ForwardAgent yes
IdentityFile ~/.ssh/id_rsa
....I've read everything I could find about the "Address already in use" error and tried modifying my config file, adding hosts to the etc/hosts file, still the same result. Any ideas?