Keeping screen Sessions Persistent With ssh Connections Over Poor Connections
Thursday, January 31, 2013, Modified: Thursday, January 31, 2013 Refs

Using ssh over a cruddy connection like a Starbucks WiFi that keeps dropping you, you probably want to use screen to keep your session running on your host when your connection goes down. That's all fine and well, but make sure you also add the "-t" option to ssh when you connect like this:

ssh -t [email protected]
When you restart ssh after you are dropped, use the -dr (disconnect elsewhere and reconnect) options to get your previous screen session back.
screen -dr
With those options you should be able to achieve a persistent ssh session with screen like you would have expected to have had out of the box.

Let me know if you have a link to a good posting on why this magic works and I will add it here.

Try Buffer, a smarter way to share links and pictures by spreading your tweets and posts out over time. Sign up from this link and we both get extra features.

Home :: Items