ssh exit mechanism!

hari sekar a_ghsek at
Wed Oct 10 18:24:53 EST 2001

To whomsoever it may concern,
    I use putty-0.51 as ssh client on windows and
openssh-2.9p2 implementation on RedHat 7.0 Linux as
ssh server. For the client to exit, I expected ssh
client to send SSH_CMSG_EOF to the server and the
server respond with SSH_CMSG_EXITSTATUS and finally
close the connection when the client sends
SSH_CMSG_EXIT_CONFIRMATION. This will effectively end
the server_loop in the server. This would close the
connection in a cleaner way. Although the RFC has
stated that either side may send SSH_MSG_DISCONNECT,
for immediate disconnect, I am surprised that this is
the normal exit method used in putty implementation. 
       I fear that any addition of code after
server_loop, to be done once the connection is closed
by the server might not get called, as it now is
redirected to fatal_cleanup(). 
     Is this normal and do other implementations
follow this?

   And I would also like to know about the ssh
hang-on-exit problem. Why is it necessary to redirect
stdin to /dev/null to prevent this? How does this end
processes running in background?

   Expecting your reply,

Do You Yahoo!?
Send a newsletter, share photos & files, conduct polls, organize chat events. Visit

More information about the openssh-unix-dev mailing list