Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am connecting from Linux via SSH to a Windows machine running SSH in Cygwin. I authenticate with a certificate. The session opens but closes immediately thereafter. With password authentication it works well - the session remains active until I log out.

I have neither knowledge nor control over the server setup but their admin is unable to troubleshoot it as he has limited knowledge of both Linux and SSH himself.

So I am trying to determine what may be the causes of this behavior so that I can pass this information to the admin who can then fix their setup.

When I run ssh with the verbose output turned on, I get this:

debug1: Trying private key: /home/user/.ssh/identity
debug1: Offering public key: /home/user/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp [some MAC-like sequence]
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/user/.ssh/id_rsa': 
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 131072
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Mon Oct 18 20:19:58 2010 from ip-xyz
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd close
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Connection to example.com closed.
Transferred: sent 2544, received 3160 bytes, in 0.2 seconds
Bytes per second: sent 10327.0, received 12827.5
debug1: Exit status 255

(I edited some identifying but probably meaningless bits)

So it seems that right after logging in the client receives some bits it does not like and closes the connection.

share|improve this question

1 Answer 1

How are you running ssh on the client side? Are you trying to run a command on the remote machine, or just get a shell?

The "rcvd eof" probably indicates that the remote side disconnected. If you can't get to the debug logs on the server side, I'd try moving shell startup (.profile, .bash_profile, .bashrc, etc) files out of the way and see if one of them is causing issues.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.