Operating System - HP-UX
1834554 Members
3737 Online
110069 Solutions
New Discussion

ssh login - connection closed immediately

 
SOLVED
Go to solution
Camel_1
Valued Contributor

ssh login - connection closed immediately

Hi there,

I was trying to login a server using secure shell, right after enter the password the connection was closed immediately.

I sure I have enter the correct password, telnet is fine, syslog shown "Accepted keyboard-interactive/pam".

Any idea why would it be happened?

Thanks,

Simon
11 REPLIES 11
Ermin Borovac
Honored Contributor

Re: ssh login - connection closed immediately

To debug start another instance of sshd on a different port (e.g. 22222).

# sshd -ddd -p 22222

and this on the client

# ssh -vvv -p 22222
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

I have turned on the debug, didn't see any adnormal .... attached is the server log.
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

and here is the client log ...
Ermin Borovac
Honored Contributor
Solution

Re: ssh login - connection closed immediately

Not sure why but your attachments are empty ...
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

serverlog.txt
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

server log file attached
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

not sure why all attachment are 0 bytes, I have extracted the last couple line of the server and client here ... hope you may find something ..

Client log ........
debug2: input_userauth_info_req: num_prompts 1
Password:
debug3: packet_send2: adding 32 (len 22 padlen 10 extra_pad 64)
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug3: packet_send2: adding 48 (len 10 padlen 6 extra_pad 64)
debug1: Authentication succeeded (keyboard-interactive).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Entering interactive session.
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t3 r-1 i0/0 o0/0 fd 5/6 cfd -1)

debug3: channel 0: close_fds r 5 w 6 e 7 c -1
Connection to etuhnr08 closed by remote host.
Connection to etuhnr08 closed.
debug1: Transferred: stdin 0, stdout 0, stderr 79 bytes in 0.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 4048.0
debug1: Exit status -1

Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

and here is the server log ..

debug3: mm_request_send entering: type 47
Accepted keyboard-interactive/pam for sleong from 198.162.30.23 port 60212 ssh2
debug3: mm_do_pam_account returning 1
Accepted keyboard-interactive/pam for sleong from 198.162.30.23 port 60212 ssh2
debug1: monitor_child_preauth: sleong has been authenticated by privileged process
debug3: mm_get_keystate: Waiting for new keys
debug3: mm_send_keystate: Sending new keys: 4002e9e8 40027010
debug3: mm_request_receive_expect entering: type 24
debug3: mm_newkeys_to_blob: converting 4002e9e8
debug3: mm_newkeys_to_blob: converting 40027010
debug3: mm_send_keystate: New keys have been sent
debug3: mm_send_keystate: Sending compression state
debug3: mm_request_send entering: type 24
debug3: mm_send_keystate: Finished sending state
debug3: mm_request_receive entering
debug3: mm_newkeys_from_blob: 400328d0(118)
debug2: mac_init: found hmac-md5
debug3: mm_get_keystate: Waiting for second key
debug3: mm_newkeys_from_blob: 400328d0(118)
debug2: mac_init: found hmac-md5
debug3: mm_get_keystate: Getting compression state
debug3: mm_get_keystate: Getting Network I/O buffers
debug3: mm_share_sync: Share sync
debug3: mm_share_sync: Share sync end
debug2: User child is on pid 5199
debug3: mm_request_receive entering
debug3: PAM: opening session
debug1: do_cleanup
debug1: PAM: cleanup
debug3: PAM: sshpam_thread_cleanup entering

clinethost: / #
Ermin Borovac
Honored Contributor

Re: ssh login - connection closed immediately

> debug3: PAM: opening session
> debug1: do_cleanup
> debug1: PAM: cleanup
> debug3: PAM: sshpam_thread_cleanup entering

Strange, it fails right after opening a session but no error.

Can you show what's in /etc/pam.conf?

Do you have TCP wrappers installed on this server?

Does this error happen only for this user?

What's the version of ssh on the client/server?

Do you have recent libpam/libpam_unix patches installed on the server?

Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

Ermin, thank you very much.

My bad, the libpam patch was missing on the server, after installed its working okay.

Thanks,

Simon
Camel_1
Valued Contributor

Re: ssh login - connection closed immediately

resolved.