|
From: | John Davidorff Pell |
Subject: | Re: Reestablishing ssh connections via screen |
Date: | Wed, 22 Jun 2005 19:40:49 -0000 |
On 22 Jun 2005, at 10:58, JCA wrote:
JCA wrote:I have a Linux notebook that connects to a Linux server by ssh. Thenotebook can be suspended to disk at any time, while ssh sessions tothe server are still running. How can screen be used so that, when the notebook is brought back from its dormant state, whatever ssh sessionsit had active with the server, at the time the notebook was put to sleep, are automatically re-established?I dunno how you would set up your laptop to do this, but all that's really needed is for you to ssh back to every computer you had previously connected to (however, the connections might just still be alive when you wake) and run "screen -r" on each host. This will reconnect to detached screen sessions.Hmm.... I am confused. Do I run screen both on the notebook and the server, or only on the notebook? Also, if the ssh session has been terminated by the server, how can screen reconnect it? Notice that I want to reconnect to exactly the same session I had, inside which I might have been running at the time some other application, like, say, an editor. Can screen really do this?
Screen runs only on the server. You ssh from your laptop to the server, and run the program `screen'. This program then runs a shell under it. You disconnect. When you disconnect, screen does NOT quit, it keeps running. Later, you reconnect from your laptop to the server. You run the program `screen' again, but this time you add '- r' (`screen -r'). You now are again running screen, which has a shell under it *but* you are running the *same* screen that you were running before, with the same shell under it as before. Does that make sense?
Now, screen's strength comes in when you realise that screen doesn't just run one shell underneath it, but it has 40 possible windows, each running whatever shell or program you like. Screen does not work with X11.
JP --for ( i=0 ; i< MAX_BASE ; i++ ) if ( belongsTo[base[i]] == YOU ) belongsTo[base[i]] = US ;
smime.p7s
Description: S/MIME cryptographic signature
[Prev in Thread] | Current Thread | [Next in Thread] |