1
I'm trying to find some invocation of sshd
(OpenSSH on Ubuntu) that accepts only one connection, and then terminates the sshd
process when that one connection closes.
I see nothing in the sshd
docs that would indicate that this is intrinsically possible, so I was thinking that it might be possible to rig up nc
as a one-shot proxy, but that doesn't seem to solve the problem where the sshd
process continues running after the connection has closed.
Anyone have any ideas?
Sounds awfully XY-ish. What are you actually trying to achieve?
– Daniel B – 2015-11-19T17:15:04.537Running
sshd
on an instance in a cluster and connecting to it. On this cluster job/instance lifecycle is tied to the lifetime of the launched process. I want to spawn the instance, connect to it once, and then have it automatically die when the client disconnects. I guess the "only one connection" thing isn't strictly required, but, the bottom line is that thesshd
process needs to die when the last client connection goes away. – ipmcc – 2015-11-19T17:21:13.393