Is it possible to run some command (as root/the sshd user) when a client disconnects?
Or some other method of killing sshd after a single connection terminates?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
sshd -d
does what you want, but it's not designed for regular use.sshd -d
, the debug mode where the tool processes exactly one connection and then exits.sshd -D
processes many connections (consecutive, simultaneous, it doesn't matter) just fine, it does not exit. This is exactly what I expected after reading the documentation.sshd -d
actually exits after processing the first connection (which counts even if it fails to authenticate, even if it doesn't "speak" SSH).