OpenSSH with "resumable" functionality

Misha Koshelev misha680 at gmail.com
Tue Apr 20 05:23:06 EST 2010


Daniel Kahn Gillmor wrote:
> On 04/19/2010 08:20 AM, Misha Koshelev wrote:
>> Chris Wilson wrote:
>>> while ! ssh user at host -o 'ServerAliveInterval 5' screen -d -RR;
>>> do true; done
>> Also right now get..
>>
>> Must be connected to a terminal.
> 
> This is probably because screen must be run while connected to a tty (or
> pseudo-tty) on the host machine, and if you supply a command argument to
> ssh, it will not ask sshd to allocate a tty by default.  You can use the
> -t flag to override this behavior.
> 
> This would make the command:
> 
>   while ! ssh -t user at host -o 'ServerAliveInterval 5' screen -d -RR;
>   do true; done
> 
> Hope this helps,
> 
> 	--dkg
> 

Thank you. I have made a very simple prototype:
misha at misha-d630:~$ more /usr/NX/bin/nxssh 
#!/bin/bash
/usr/NX/bin/mxssh misha-i1525 -tt -o "ServerAliveInterval 5" "screen -d -RR -s /home/misha/bin/nxlogin"
misha at misha-d630:~$ more /home/misha/bin/nxlogin
#!/bin/bash
ssh -i /usr/NX/share/keys/server.id_dsa.key -t nx at localhost
misha at misha-d630:~$ 

This seems to _almost_ work, except screen garbles some characters.

I think I might try my hand at making a very very simple screen-like utility with less functionality (one shot), unless
something like this is available already?

i.e. a program that:
i) if no session, makes new "detachable" session that runs some command - no control chars, nothing
ii) if a session exists, reattaches

Any clues?

Thank you
Misha


More information about the openssh-unix-dev mailing list