This post has already been written, in one way or another, thousands of times across the web.
I'm rewriting it for two reasons, command reference and
Mosh (mobile shell)
Mosh uses UDP to create an unbreakable ssh session. If you're on the road with flaky connections, it's a lifesaver.
On Windows, you can use
mosh either in WSL or Cygwin. If using via Cygwin, you may stumble on the error «Did not find remote IP address (is SSH ProxyCommand disabled?)».
$ ./mosh [email protected] CreateProcessW failed error:2 posix_spawnp: No such file or directory ./mosh: Did not find remote IP address (is SSH ProxyCommand disabled?).
To fix it, it's a simple as passing a few extra parameters:
$ ./mosh --predict=always --experimental-remote-ip=remote [email protected]
--predict=controls use of speculative local echo
--experimental-remote-ip= used to discover IP address mosh connects to
Notice that if you're having errors connecting, you should check if you're actually allowed to UDP into the server. For that use
tmux (terminal multiplexer)
tmux puts your terminal connection into a proper session. Say you're working on a remote server from your home. You can disconnect that session. Go to work and resume the session exactly as it was.
On top of that, it allows you to easily split the screen.
tmux new - to start
tmux new -s session-name - to name the session
tmux -t session-name - to attach to the named session
During the session, your go-to command is
Ctrl+b % - splits the screen vertically
Ctrl+b " - splits the screen horizontally
Ctrl+b x - closes current session