OpenSSH with "resumable" functionality

Iain Morgan imorgan at nas.nasa.gov
Thu Jun 10 09:05:26 EST 2010


On Mon, Apr 19, 2010 at 14:23:43 -0500, Andreas Gunnarsson wrote:
> > On Sun, Apr 18, 2010 at 05:26:06PM -0500, Misha Koshelev wrote:
> > > I was wondering if it might at all be possible to have the following functionality in OpenSSH:
> > > (i) upon "timeout" of connection (say 2-5 seconds) disconnect
> > > (ii) keep trying to reconnect
> > > (iii) upon reconnection, resume session exactly where started
> 
> On Mon, Apr 19, 2010 at 01:08:36PM +0200, Markus Friedl wrote:
> > this is a work-in-progress, some parts are already commited to
> > the released versions. other parts need to be reviewed.
> > 
> > Andreas can provide details, I think -- and yes, I should 
> > look into reviewing the remaining patches.......
> 
> I've made the patch available here:
> 
>    http://www.zzlevo.net/ssh-roaming.diff
> 
> This is a diff against OpenBSD-current which adds "roaming" to allow an
> ssh session to be suspended (i.e. terminate the TCP session) and then
> resumed over a new TCP session. The client may resume from the same or a
> new IP address.
> 
> A solution which just sets up a new ssh session would tear down open
> port forwarded TCP sessions. This patch keeps the client and server
> processes running, and applications that use port forwards will not
> notice that the ssh session has been suspended and resumed.
> 
> The session is not resumed automatically (the user has to press return)
> but that could be a possible enhancement once this is committed. The
> patch is based on code written by Martin Forssén and donated by my
> previous employer, AppGate. I haven't made a version for portable
> OpenSSH but anyone who wants to will probably be able to do that with
> minimal effort.
> 
> As Markus said, this hasn't been fully audited yet. It does touch the
> preauth and privsep parts of the code so use on your own risk. :)
> 
>    Andreas

Hello Andreas,

The recent discussion on this thread reminded me that I had intended to
take a look at your patch. ;-)

At this point, I've only glanced at the patch, but it looks interesting
thus far. A scenario that I am particularly interested in is resumption
of long file transfers after network hiccups. (By 'long' I mean on the
order of 100GB to 1TB.) In such a scenario, hitting return to resume the
ssh session would not be effective. 

One solution would be to add the ability for ssh to automatically resume
the session. An alternative would be to add a 'resume' command to ssh's
-O option. Of course, this assumes that a ContolPath has been configured
for the client. This would also be useful for backgrounded
port-forwarding or multiplex master sessions.

Perhaps the -O support is already there, but I did not see it during my
cursory skim of the man page updates in the patch.

Regards,

-- 
Iain Morgan


More information about the openssh-unix-dev mailing list