Articles

SSH and screen

Nothing is more frustrating than having an SSH connection broken while you're actively working on it.  Or even if an attended job is running and then you have to leave and power off your laptop. To go around this, I always do my ssh session as follows: ssh -t <host> screen -R -D What ssh does, it either starts a screen session or reuse an existing one if there is one available. I then do put this in my .zshrc (or .bashrc) file function ssh-screen {   ssh -t $1 screen -R -D }