How can I maintain ssh connection from my Windows laptop to Ubuntu desktop

1

I need to ssh from Windows laptop to my Ubuntu desktop. So at work I in cygwin , I ssh to Ubuntu desktop. But at home, I need to login to VPN and I need to re-ssh to ubuntu desktop.

And some times at home, I suspend my laptop and lost my VPN connection and I need to relogin VPN.

My question is does screen allow me to maintain my ssh connection after my connection is disconnected and I need to manually connected?

Thank you.

michael

Posted 2014-03-13T20:17:09.473

Reputation: 4 127

Thanks for marking as the answer! Feel free to Up-Vote as well, if it helped you. – Canadian Luke – 2014-03-17T17:24:05.480

Answers

0

Yes it does! It's what I use (as described on my blog post about it), and it goes between different connections: different SSH, Telnet (if I was brave!), or the console!

Start it with the plain old screen command, then start your work. If you get disconnected, oh well! When you re-establish connection (via SSH, I assume), run screen -r as the same user, and you're instantly connected!

Canadian Luke

Posted 2014-03-13T20:17:09.473

Reputation: 22 162

It does not work for me. on my laptop, I VPN to work. In cygwin shell, I ssh to my work laptop. I disconnect VPN. The shell said 'Write faield. Connection reset by peer'. And I reconnect VPN, at this time, i go back to cygwin shell and type 'screen -r' It said 'There is a screen on 5333.pty0.LTREA-MIKE (Attached) There is no screen to be resumed'. I – michael – 2014-03-14T06:13:38.930

Are you using the plain "screen" command once you connect via ssh? – Canadian Luke – 2014-03-14T14:30:24.610

Do you mean i need to do 'screen' on my laptop and then 'screen' on my remote desktop after I connect it via ssh? I am confused where should I run 'screen' and 'screen -r'? – michael – 2014-03-14T23:03:17.060

Run the commands on the remote server. Screen starts the session. When you need to reconnect, log in to the server, and run screen -r to reconnect – Canadian Luke – 2014-03-15T00:09:43.193