How to keep ssh session alive longer
- More often
sshtimes out when the user is not using the terminal for a few minutes.
- The remote server disconnects the silent clients; Annoying!
- Two ways to resolve from client-side on Linux Mint/Ubuntu/Any
Way 1 (works great!)
- while connecting via ssh add few flags
ssh -o ServerAliveInterval=60 <myname>@<myremote-host-or-ip-address>
Host * ServerAliveInterval 240
- chmod 600 $HOME/.ssh/config
Alias ssh - Way 1
~/.bashrc, towards the end
alias sshlive='ssh -o ServerAliveInterval=60'
- Open a new terminal or run
- See, list of aliases that are set. Type
- Next time, when I want ssh we need not remember the long command.
- Just type
- Thanks to
Cheers and thanks to SO!