[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reestablishing ssh connections via screen

From: JCA
Subject: Re: Reestablishing ssh connections via screen
Date: Thu, 23 Jun 2005 16:04:50 -0700

> This is the typical way to use screen:
> - Turn on your laptop, open ssh connection to the server
> - On the server: type 'screen'
> - screen will give you a shell, just like when you log in normally
> - Do work that you need inside that shell
> - If you get disconnected, such as when you turn off your laptop, screen
> will still be running on the server
> - When you want to reconnect, turn on your laptop, and connect through
> ssh to the server again
> - type 'screen -D -R' to resume screen where it was before you turned
> off your laptop.
> It is not possible to resume the exact SSH connection when you turn off
> your laptop because networking doesn't work that way.  Instead, you must
> create a new SSH connection and then use screen to resume what you were
> doing inside the screen session.

   Thanks so much for the very useful feedback that you and other
contributors to this list have come up with. It seems to be the case
that using screen the way you describe, plus autossh, as pointed out
by somebody else, goes a long way to achieving what I want. There is a
wrinkle though:

   In my notebook, I usually have more than one ssh sessions to the
server, on separate windows. If I use twice the rscreen script that
comes with autossh, I can get two windows but attached to the same
screen. That is, whatever I do in one of them, is just echoed on the
other. This can be potentially useful, but it is not what I need.

   I would need to be able to open several, independent screen
sessions on different windows, and automatically reattach to each of
them correctly and separately after bringing the notebook back online
again. Is this possible with a combination of autossh and screen?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]