Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. 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.

(this is a cross-post from SU http://superuser.com/questions/200756/, where it arguably does not belong)

share|improve this question

1 Answer 1

Guessing here:

Are there any "forced-commands" in your ~/.ssh/authorized_keys on the server or for that matter any other restrictions? If the lines there just start with "ssh-rsa AAAAB3Nz" then everything in that direction should be ok.

share|improve this answer
    
Nope, authorized_keys only contains my key, but I do not know about "forced commands" and if they are present in other config files –  Tomas Kohl Oct 21 '10 at 11:02
    
the only other place I know of where forced commands could be placed is /etc/ssh/sshd_config but as far as I know there they are always user specific and can not change based on authentication. –  Marcel G Oct 22 '10 at 12:01

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.