Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unrelated in many ways, but I have the reverse problem:

When I suspend my Linux machine, my ssh connections are lost.

Anyone know of a good solution for this?

PS: Yes, I know about tmux/screen but I'd like a solution that keeps the connection, because I often forget to start a screen session. Also, I'd like my X11 applications to keep working.





Mosh on server and client keeps the SSH connection going during suspension or network drops, etc.

https://github.com/mobile-shell/mosh


Nice! But not a solution since it does not support X11 forwarding.

WDYM lost? do you roam? I used to have a job with simple OpenVPN to connect to the servers (via public IP, just routed through the VPN tunnel) and ssh connections stayed during my trip from office to home. Probably needs both sides not to be overly aggressive with keepalives and such. VPN just reconnected at home, but tun0 device and its local ip stayed the same, ssh connections also stayed.

If you do not roam other side may do TCP keepalives or even ssh protocol keepalives and close the connection for you. Unless you can tune that, not much to do.

Other solutions might be mosh (mobile shell; haven't tried) or just running screen or tmux on the other end and just resume where you left of after quick reconnect.


Use tmux. Ssh in and start a tmux session. If the connection breaks you can ssh back in and reconnect to the tmux session later.

GNU Screen is another alternative


Yes, thanks, but it does not work for me since X11 applications lose their connection too.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: