[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ssh disconnects immediately after successful login





On 12/16/15 8:19 PM, David Christensen wrote:
On 12/16/2015 05:29 AM, Kent West wrote:
If I try to connect to my Debian box at work, using either my Mac's OS X
or my Mac's Debian VM, I can connect successfully, but then immediately
the connection is closed:

Kents-MacBook-Pro:~ westk$ ssh -Y westk@westek.acu.edu
westk@westek.acu.edu's password:
Connection to westek.acu.edu closed by remote host.
Connection to westek.acu.edu closed.
Kents-MacBook-Pro:~ westk$

I can ssh to a different Debian box on my work network, and then do an
ssh hop from there to my work box.

Also, if I start up the Virtual Private Network (VPN) client first, so
that I'm essentially on my work network rather than on my home network,
I get connected successfully.

So apparently something about my Debian box at work doesn't like
incoming ssh sessions from non-work networks. However, I can find
nothing to configure that.

Which version of Debian?


westk@westek:~$ cat /etc/debian_version
stretch/sid


The following ideas are for Jessie.


'man ssh' tells me:

     -v      Verbose mode.  Causes ssh to print debugging messages
             about its progress.  This is helpful in debugging connec-
             tion, authentication, and configuration problems. Multi-
             ple -v options increase the verbosity.  The maximum is 3.

Add the -v option, one or more times, and see what happens.

Kents-MacBook-Pro:~ westk$ ssh -vvv westk@westek.acu.edu
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to westek.acu.edu [150.252.155.27] port 22.
debug1: Connection established.
debug1: identity file /Users/westk/.ssh/id_rsa type -1
debug1: identity file /Users/westk/.ssh/id_rsa-cert type -1
debug1: identity file /Users/westk/.ssh/id_dsa type -1
debug1: identity file /Users/westk/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version xxxxxxx
debug1: no match: xxxxxxx
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "westek.acu.edu" from file "/Users/westk/.ssh/known_hosts" debug3: load_hostkeys: found key type RSA in file /Users/westk/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-dss debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96 debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 129/256
debug2: bits set: 1023/2048
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 70:d8:45:fd:9a:55:05:f6:97:18:01:45:5c:06:77:19
debug3: load_hostkeys: loading entries for host "westek.acu.edu" from file "/Users/westk/.ssh/known_hosts" debug3: load_hostkeys: found key type RSA in file /Users/westk/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "150.252.155.27" from file "/Users/westk/.ssh/known_hosts" debug3: load_hostkeys: found key type RSA in file /Users/westk/.ssh/known_hosts:1
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'westek.acu.edu' is known and matches the RSA host key.
debug1: Found key in /Users/westk/.ssh/known_hosts:1
debug2: bits set: 1007/2048
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/westk/.ssh/id_rsa (0x0),
debug2: key: /Users/westk/.ssh/id_dsa (0x0),
debug1: Authentications that can continue: password
debug3: start over, passed a different list password
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup password
debug3: remaining preferred: ,keyboard-interactive,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
westk@westek.acu.edu's password:
debug3: packet_send2: adding 64 (len 58 padlen 6 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
Authenticated to westek.acu.edu ([150.252.155.27]:22).
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 cc -1)

Connection to westek.acu.edu closed by remote host.
Connection to westek.acu.edu closed.
Transferred: sent 2208, received 1696 bytes, in 0.0 seconds
Bytes per second: sent 68746.8, received 52805.5
debug1: Exit status -1
Kents-MacBook-Pro:~ westk$



On the destination computer, take a look at the files in /var/log (notably auth.log and syslog).

westk@westek:~$ sudo tail /var/log/auth.log
Dec 16 20:51:53 westek sshd[17550]: Accepted password for westk from 50.26.189.223 port 60677 ssh2 Dec 16 20:51:53 westek sshd[17550]: pam_unix(sshd:session): session opened for user westk by (uid=0)
Dec 16 20:51:53 westek systemd-logind[733]: New session c70 of user westk.
Dec 16 20:51:53 westek sshd[17550]: pam_unix(sshd:session): session closed for user westk
Dec 16 20:51:53 westek systemd-logind[733]: Removed session c70.
Dec 16 20:51:59 westek sudo: westk : TTY=pts/4 ; PWD=/home/westk ; USER=root ; COMMAND=/usr/bin/tail /var/log/auth.log Dec 16 20:51:59 westek sudo: pam_unix(sudo:session): session opened for user root by westk(uid=0)



westk@westek:~$ sudo tail -20 /var/log/syslog
Dec 16 20:50:21 westek console-kit-daemon[1519]: (process:17519): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:50:21 westek console-kit-daemon[1519]: missing action
Dec 16 20:50:21 westek console-kit-daemon[1519]: (process:17524): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:50:21 westek console-kit-daemon[1519]: missing action
Dec 16 20:50:21 westek console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1403 was not found when attempting to remove it Dec 16 20:50:21 westek console-kit-daemon[1519]: console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1403 was not found when attempting to remove it
Dec 16 20:51:19 westek systemd[1]: Started Session c69 of user westk.
Dec 16 20:51:19 westek console-kit-daemon[1519]: (process:17541): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:51:19 westek console-kit-daemon[1519]: missing action
Dec 16 20:51:19 westek console-kit-daemon[1519]: (process:17546): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:51:19 westek console-kit-daemon[1519]: missing action
Dec 16 20:51:19 westek console-kit-daemon[1519]: console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1421 was not found when attempting to remove it Dec 16 20:51:19 westek console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1421 was not found when attempting to remove it
Dec 16 20:51:53 westek systemd[1]: Started Session c70 of user westk.
Dec 16 20:51:53 westek console-kit-daemon[1519]: (process:17553): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:51:53 westek console-kit-daemon[1519]: missing action
Dec 16 20:51:53 westek console-kit-daemon[1519]: (process:17558): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Dec 16 20:51:53 westek console-kit-daemon[1519]: missing action
Dec 16 20:51:53 westek console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1439 was not found when attempting to remove it Dec 16 20:51:53 westek console-kit-daemon[1519]: console-kit-daemon[1519]: GLib-CRITICAL: Source ID 1439 was not found when attempting to remove it
westk@westek:~$

David




Reply to: