[aklug] Re: resuming borked sessions

From: Everett Haimes <everett@powernode.net>
Date: Mon Feb 24 2014 - 09:45:37 AKST

For years I've been using a utility called screen to manage persistent SSH sessions. It's easy to use, you just SSH in to your host and type screen.

Here's the manual: https://www.gnu.org/software/screen/manual/screen.html

Once in the screen session you can (C = control key):

Create a new screen: C-a c
Switch to next session: C-a n
Switch to previous session: C-a p
Fit to window: C-a F
Scroll through history buffer: C-a ESC
Detach: C-a d
Help: C-a ?

If you disconnect from a screen session, all you have to do is SSH back in and type "screen -r" to reconnect or "screen -x" to reconnect to a currently attached session. You can also add user permissions and share screen sessions with multiple people which is very nice for assisting others. It also continues to function whether you are connected or now which is nice for remote downloads, etc.

The best part is it's included with most distributions.

Hope this helps!

Everett Haimes
www.nodealchemy.com

----- Original Message -----
> From: "Shane Spencer" <shane@bogomip.com>
> Cc: "AKLUG" <aklug@aklug.org>
> Sent: Monday, February 24, 2014 8:59:39 AM
> Subject: [aklug] Re: resuming borked sessions
>
> I use mosh primarily over SSH for console sessions now. No timeout
> issues.. predictive typing.. collapsing of screen updates into single
> packets.
>
> I work from my office in Anchorage and shell into a server in Fairbanks for
> more than half of my time. Typically this wouldn't be an issue however I
> have 0 control of the Fairbanks network and it is often at 90 to 100%
> capacity which can easily squish a few connections due to timeouts or loss.
>
> My only gotcha here is that I still haven't invested the time to have
> urxvt's key commands not overlap mosh's or the other way around. I usually
> just kill the window.
>
> I couple Mosh with OpenSSH's ControlMaster and ControlPersist settings to
> help quickly set up the initial SSH requirement before it drops everything
> to UDP.
>
> Mosh is for shells. It doesn't do redirection of ports or anything else.
> I wouldn't consider it a one trick pony however.. the trick is phenomenal
> and unparalleled.
>
> As for TCP connection state and forwarding.. there was a tool called rock
> way back in the day that attempted to handle this. It would unfortunately
> do so by completely hijacking the socket library. It showed off quite a
> few things the expectations that TCP communications provides that you just
> can't have any one thing just magically take care of. The biggest being
> you can keep a TCP session alive (via a proxy) but the application layer
> probably has some reasonable timeouts.. not everything is event driven any
> always simply waiting for data.
>
> SSH will time out via a proxy even if the proxy keeps the TCP connection
> alive. There are keepalives, ping intervals. All of which you can
> disable.. but eventually you will have an inconsistent state. HTTP would
> be similar, where you can't control what the remote side will consider a
> dead connection. Given the state of the HTTP work being done since the
> dawn of the Internet.. if you had a solution for this you'd be hijacking an
> available thread on a web server for hours and that just ain't cool dog.
>
> Mosh avoids this by directly addressing it in its connection design.
>
> - Shane
>
>
> On Mon, Feb 24, 2014 at 6:24 AM, Royce Williams <royce@tycho.org> wrote:
>
> > On Mon, Feb 24, 2014 at 6:14 AM, Royce Williams <royce@tycho.org> wrote:
> >
> > >> Try Mosh.
> >
> > Sorry to keep spamming the list, but the more I read about this, the
> > cooler it gets.
> >
> > It actually uses SSH to connect to a remote server, fires up the
> > mosh-server user process (no daemon or root access required!), and
> > then your connection rides mosh after that.
> >
> > Installing it is super easy; here are one-liner install instructions
> > for most Unix-likes:
> >
> > http://mosh.mit.edu/#getting
> >
> > There are some drawbacks (no X11 forwarding yet, but on the roadmap)
> > ... but I just convinced myself to actually set it up and start
> > testing it.
> >
> > Royce
> > ---------
> > To unsubscribe, send email to <aklug-request@aklug.org>
> > with 'unsubscribe' in the message body.
> >
> >
>
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Mon Feb 24 09:46:20 2014

This archive was generated by hypermail 2.1.8 : Mon Feb 24 2014 - 09:46:20 AKST