Autossh – automatically restart SSH sessions and tunnels
1–10 of 90 posts
Re: Autossh – automatically restart SSH sessions and tunnels
#2Curious what advantages this has over mosh?
Re: Autossh – automatically restart SSH sessions and tunnels
#3Curious what advantages this has over mosh? https://mosh.org/
[deleted]
Re: Autossh – automatically restart SSH sessions and tunnels
#4Curious what advantages this has over mosh? https://mosh.org/
mosh is for interactive sessions, to keep them working when the connection is flaky.
autossh is for keeping unattended ssh tunnels alive, if the connection is flaky or one end is only intermittently available. So for using tunnels for the sort of thing you might otherwise use a VPN for.
Re: Autossh – automatically restart SSH sessions and tunnels
#5Rather than using AutoSSH for port forwarding and such, I just create a systemd unit with a restart policy. Then you don't need autossh at all, just use ssh.
Re: Autossh – automatically restart SSH sessions and tunnels
#6If you have systemd, you could do this:
[Unit]
Description=look ma, no autossh
After=network.target
[Service]
Type=exec
ExecStart=/usr/bin/ssh -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -Nn -R 7070:localhost:22 pc 'sleep 20m'
Restart=always
RestartSec=20
RuntimeMaxSec=30m
[Install]
WantedBy=default.targetRe: Autossh – automatically restart SSH sessions and tunnels
#7I used to use autossh to set up a SOCKS proxy to tunnel my web browser traffic via my home network and it worked really well. Also had a ControlMaster on the tunnel which made SSH connections to my server instantaneous.
Nowadays I use wireguard an a dedicated SOCKS proxy. The upside is that I can access everything on my home network directly without having to tunnel.
Re: Autossh – automatically restart SSH sessions and tunnels
#8Not 100% the same use case as autossh was built for maybe, but I'm now simply throwing tailscale on every box i need to interact with. Does away with all the port forwarding stuff, it's absolutely delightful.
Re: Autossh – automatically restart SSH sessions and tunnels
#9I used autossh to do terrible things securing redis back in 2013. Fantastic tool.
Re: Autossh – automatically restart SSH sessions and tunnels
#10I used autossh to do terrible things securing redis back in 2013. Fantastic tool.
Ohh tell me more?