Problem when user's ip changes
Hi, Let's say i want to create a reverse tunnel to server b from a machine a with using this script on machine a. After tunnel is on, what would happen if the ip of machine a changes ?
I tried this script, yes it does automatically create a tunnel to server, but when the ip of device a changes, i cant access it from the server
I don't think AUTOSSH_PORT is ever passed to autossh, you can try exporting the variable or better yet rely SSH keepalives with ServerAliveInterval and ServerAliveCountMax options.
If you're using a Debian-based distribution, you can also try sidedoor, my small wrapper package to maintain an SSH connection/tunnel.