Re: SSH disconnects right after accepting

2019-02-07 Thread Максим
Hello,
Did you edit /etc/login.conf recently?

-- 
Best Regards
Maksim Rodin


08.02.2019, 03:27, "Lars Bonnesen" :
> OpenBSD 6.4
>
> Putty just reports "Authenticating with public key "XXX" from agent" and
> then I am disconnected. If I run sshd with -ddd, I get the following
> output. I can't seem to get any error, and therefor I can't tell what is
> wrong. Anyone has any idea? Thanks
>
> debug2: load_server_config: filename /etc/ssh/sshd_config
> debug2: load_server_config: done config len = 204
> debug2: parse_server_config: config /etc/ssh/sshd_config len 204
> debug3: /etc/ssh/sshd_config:25 setting LogLevel DEBUG
> debug3: /etc/ssh/sshd_config:30 setting PermitRootLogin no
> debug3: /etc/ssh/sshd_config:39 setting AuthorizedKeysFile
> .ssh/authorized_keys
> debug3: /etc/ssh/sshd_config:86 setting Subsystem sftp
> /usr/libexec/sftp-server
> debug1: sshd version OpenSSH_7.9, LibreSSL 2.8.2
> debug1: private host key #0: ssh-rsa SHA256:XXX
> debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:XXX
> debug1: private host key #2: ssh-ed25519 SHA256:XXX
> debug1: rexec_argv[0]='/usr/sbin/sshd'
> debug1: rexec_argv[1]='-ddd'
> debug2: fd 3 setting O_NONBLOCK
> debug1: Bind to port 22 on 0.0.0.0.
> Server listening on 0.0.0.0 port 22.
> debug2: fd 4 setting O_NONBLOCK
> debug1: Bind to port 22 on ::.
> Server listening on :: port 22.
> debug1: fd 5 clearing O_NONBLOCK
> debug1: Server will not fork when running in debugging mode.
> debug3: send_rexec_state: entering fd = 8 config len 204
> debug3: ssh_msg_send: type 0
> debug3: send_rexec_state: done
> debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
> debug1: inetd sockets after dupping: 3, 3
> Connection from 172.17.4.3 port 63721 on 172.17.1.2 port 22 rdomain "0"
> debug1: Client protocol version 2.0; client software version
> PuTTY_Release_0.70
> debug1: no match: PuTTY_Release_0.70
> debug1: Local version string SSH-2.0-OpenSSH_7.9
> debug2: fd 3 setting O_NONBLOCK
> debug3: ssh_sandbox_init: preparing pledge sandbox
> debug2: Network child is on pid 89382
> debug3: preauth child monitor started
> debug3: privsep user:group 27:27 [preauth]
> debug1: permanently_set_uid: 27/27 [preauth]
> debug1: list_hostkey_types:
> rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
> debug3: send packet: type 20 [preauth]
> debug1: SSH2_MSG_KEXINIT sent [preauth]
> debug3: receive packet: type 20 [preauth]
> debug1: SSH2_MSG_KEXINIT received [preauth]
> debug2: local server KEXINIT proposal [preauth]
> debug2: KEX algorithms:
> curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
> [preauth]
> debug2: host key algorithms:
> rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
> debug2: ciphers ctos: chacha20-poly1...@openssh.com
> ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
> aes256-...@openssh.com [preauth]
> debug2: ciphers stoc: chacha20-poly1...@openssh.com
> ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
> aes256-...@openssh.com [preauth]
> debug2: MACs ctos: umac-64-...@openssh.com,umac-128-...@openssh.com,
> hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
> hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
> [preauth]
> debug2: MACs stoc: umac-64-...@openssh.com,umac-128-...@openssh.com,
> hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
> hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
> [preauth]
> debug2: compression ctos: none,z...@openssh.com [preauth]
> debug2: compression stoc: none,z...@openssh.com [preauth]
> debug2: languages ctos: [preauth]
> debug2: languages stoc: [preauth]
> debug2: first_kex_follows 0 [preauth]
> debug2: reserved 0 [preauth]
> debug2: peer client KEXINIT proposal [preauth]
> debug2: KEX algorithms:
> curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa2048-sha256,rsa1024-sha1,diffie-hellman-group1-sha1
> [preauth]
> debug2: host key algorithms:
> ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
> [preauth]
> debug2: ciphers ctos: aes256-ctr,aes256-cbc,rijndael-...@lysator.liu.se
> ,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,chacha20-poly1...@openssh.com,blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
> [preauth]
> debug2: ciphers stoc: aes256-ctr,aes256-cbc,rijndael-...@lysator.liu.se
> ,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,chacha20-poly1...@openssh.com,blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
> [preauth]
> debug2: MACs ctos: hmac-sha2-256,hmac-sha1,hmac-sha1-96,hmac-md5,
> 

Re: SSH disconnects right after accepting

2019-02-07 Thread Aaron Mason
Can you share your sshd_config file, and ~user/.ssh/rc  and
~user/.ssh/config files (if they exist) please.

On Fri, Feb 8, 2019 at 12:07 PM Lars Bonnesen  wrote:
>
> No, clear text login also does not work. Only when I log on through the 
> console, not say.
>
> Regards, Lars.
>
> On Fri, Feb 8, 2019, 02:03 Aaron Mason >
>> Hi
>>
>> Does it work fine if you log in with the user's password?
>>
>> On Fri, Feb 8, 2019 at 11:25 AM Lars Bonnesen  
>> wrote:
>> >
>> > OpenBSD 6.4
>> >
>> > Putty just reports "Authenticating with public key "XXX" from agent" and
>> > then I am disconnected. If I run sshd with -ddd, I get the following
>> > output. I can't seem to get any error, and therefor I can't tell what is
>> > wrong. Anyone has any idea? Thanks
>> >
>> >
>> > debug2: load_server_config: filename /etc/ssh/sshd_config
>> > debug2: load_server_config: done config len = 204
>> > debug2: parse_server_config: config /etc/ssh/sshd_config len 204
>> > debug3: /etc/ssh/sshd_config:25 setting LogLevel DEBUG
>> > debug3: /etc/ssh/sshd_config:30 setting PermitRootLogin no
>> > debug3: /etc/ssh/sshd_config:39 setting AuthorizedKeysFile
>> > .ssh/authorized_keys
>> > debug3: /etc/ssh/sshd_config:86 setting Subsystem sftp
>> > /usr/libexec/sftp-server
>> > debug1: sshd version OpenSSH_7.9, LibreSSL 2.8.2
>> > debug1: private host key #0: ssh-rsa SHA256:XXX
>> > debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:XXX
>> > debug1: private host key #2: ssh-ed25519 SHA256:XXX
>> > debug1: rexec_argv[0]='/usr/sbin/sshd'
>> > debug1: rexec_argv[1]='-ddd'
>> > debug2: fd 3 setting O_NONBLOCK
>> > debug1: Bind to port 22 on 0.0.0.0.
>> > Server listening on 0.0.0.0 port 22.
>> > debug2: fd 4 setting O_NONBLOCK
>> > debug1: Bind to port 22 on ::.
>> > Server listening on :: port 22.
>> > debug1: fd 5 clearing O_NONBLOCK
>> > debug1: Server will not fork when running in debugging mode.
>> > debug3: send_rexec_state: entering fd = 8 config len 204
>> > debug3: ssh_msg_send: type 0
>> > debug3: send_rexec_state: done
>> > debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
>> > debug1: inetd sockets after dupping: 3, 3
>> > Connection from 172.17.4.3 port 63721 on 172.17.1.2 port 22 rdomain "0"
>> > debug1: Client protocol version 2.0; client software version
>> > PuTTY_Release_0.70
>> > debug1: no match: PuTTY_Release_0.70
>> > debug1: Local version string SSH-2.0-OpenSSH_7.9
>> > debug2: fd 3 setting O_NONBLOCK
>> > debug3: ssh_sandbox_init: preparing pledge sandbox
>> > debug2: Network child is on pid 89382
>> > debug3: preauth child monitor started
>> > debug3: privsep user:group 27:27 [preauth]
>> > debug1: permanently_set_uid: 27/27 [preauth]
>> > debug1: list_hostkey_types:
>> > rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
>> > debug3: send packet: type 20 [preauth]
>> > debug1: SSH2_MSG_KEXINIT sent [preauth]
>> > debug3: receive packet: type 20 [preauth]
>> > debug1: SSH2_MSG_KEXINIT received [preauth]
>> > debug2: local server KEXINIT proposal [preauth]
>> > debug2: KEX algorithms:
>> > curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
>> > [preauth]
>> > debug2: host key algorithms:
>> > rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
>> > debug2: ciphers ctos: chacha20-poly1...@openssh.com
>> > ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
>> > aes256-...@openssh.com [preauth]
>> > debug2: ciphers stoc: chacha20-poly1...@openssh.com
>> > ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
>> > aes256-...@openssh.com [preauth]
>> > debug2: MACs ctos: umac-64-...@openssh.com,umac-128-...@openssh.com,
>> > hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
>> > hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
>> > [preauth]
>> > debug2: MACs stoc: umac-64-...@openssh.com,umac-128-...@openssh.com,
>> > hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
>> > hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
>> > [preauth]
>> > debug2: compression ctos: none,z...@openssh.com [preauth]
>> > debug2: compression stoc: none,z...@openssh.com [preauth]
>> > debug2: languages ctos:  [preauth]
>> > debug2: languages stoc:  [preauth]
>> > debug2: first_kex_follows 0  [preauth]
>> > debug2: reserved 0  [preauth]
>> > debug2: peer client KEXINIT proposal [preauth]
>> > debug2: KEX algorithms:
>> > curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa2048-sha256,rsa1024-sha1,diffie-hellman-group1-sha1
>> > [preauth]
>> > debug2: host key algorithms:
>> > 

Re: SSH disconnects right after accepting

2019-02-07 Thread Aaron Mason
Hi

Does it work fine if you log in with the user's password?

On Fri, Feb 8, 2019 at 11:25 AM Lars Bonnesen  wrote:
>
> OpenBSD 6.4
>
> Putty just reports "Authenticating with public key "XXX" from agent" and
> then I am disconnected. If I run sshd with -ddd, I get the following
> output. I can't seem to get any error, and therefor I can't tell what is
> wrong. Anyone has any idea? Thanks
>
>
> debug2: load_server_config: filename /etc/ssh/sshd_config
> debug2: load_server_config: done config len = 204
> debug2: parse_server_config: config /etc/ssh/sshd_config len 204
> debug3: /etc/ssh/sshd_config:25 setting LogLevel DEBUG
> debug3: /etc/ssh/sshd_config:30 setting PermitRootLogin no
> debug3: /etc/ssh/sshd_config:39 setting AuthorizedKeysFile
> .ssh/authorized_keys
> debug3: /etc/ssh/sshd_config:86 setting Subsystem sftp
> /usr/libexec/sftp-server
> debug1: sshd version OpenSSH_7.9, LibreSSL 2.8.2
> debug1: private host key #0: ssh-rsa SHA256:XXX
> debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:XXX
> debug1: private host key #2: ssh-ed25519 SHA256:XXX
> debug1: rexec_argv[0]='/usr/sbin/sshd'
> debug1: rexec_argv[1]='-ddd'
> debug2: fd 3 setting O_NONBLOCK
> debug1: Bind to port 22 on 0.0.0.0.
> Server listening on 0.0.0.0 port 22.
> debug2: fd 4 setting O_NONBLOCK
> debug1: Bind to port 22 on ::.
> Server listening on :: port 22.
> debug1: fd 5 clearing O_NONBLOCK
> debug1: Server will not fork when running in debugging mode.
> debug3: send_rexec_state: entering fd = 8 config len 204
> debug3: ssh_msg_send: type 0
> debug3: send_rexec_state: done
> debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8
> debug1: inetd sockets after dupping: 3, 3
> Connection from 172.17.4.3 port 63721 on 172.17.1.2 port 22 rdomain "0"
> debug1: Client protocol version 2.0; client software version
> PuTTY_Release_0.70
> debug1: no match: PuTTY_Release_0.70
> debug1: Local version string SSH-2.0-OpenSSH_7.9
> debug2: fd 3 setting O_NONBLOCK
> debug3: ssh_sandbox_init: preparing pledge sandbox
> debug2: Network child is on pid 89382
> debug3: preauth child monitor started
> debug3: privsep user:group 27:27 [preauth]
> debug1: permanently_set_uid: 27/27 [preauth]
> debug1: list_hostkey_types:
> rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
> debug3: send packet: type 20 [preauth]
> debug1: SSH2_MSG_KEXINIT sent [preauth]
> debug3: receive packet: type 20 [preauth]
> debug1: SSH2_MSG_KEXINIT received [preauth]
> debug2: local server KEXINIT proposal [preauth]
> debug2: KEX algorithms:
> curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
> [preauth]
> debug2: host key algorithms:
> rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
> debug2: ciphers ctos: chacha20-poly1...@openssh.com
> ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
> aes256-...@openssh.com [preauth]
> debug2: ciphers stoc: chacha20-poly1...@openssh.com
> ,aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,
> aes256-...@openssh.com [preauth]
> debug2: MACs ctos: umac-64-...@openssh.com,umac-128-...@openssh.com,
> hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
> hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
> [preauth]
> debug2: MACs stoc: umac-64-...@openssh.com,umac-128-...@openssh.com,
> hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,
> hmac-sha1-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
> [preauth]
> debug2: compression ctos: none,z...@openssh.com [preauth]
> debug2: compression stoc: none,z...@openssh.com [preauth]
> debug2: languages ctos:  [preauth]
> debug2: languages stoc:  [preauth]
> debug2: first_kex_follows 0  [preauth]
> debug2: reserved 0  [preauth]
> debug2: peer client KEXINIT proposal [preauth]
> debug2: KEX algorithms:
> curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa2048-sha256,rsa1024-sha1,diffie-hellman-group1-sha1
> [preauth]
> debug2: host key algorithms:
> ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
> [preauth]
> debug2: ciphers ctos: aes256-ctr,aes256-cbc,rijndael-...@lysator.liu.se
> ,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,chacha20-poly1...@openssh.com,blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
> [preauth]
> debug2: ciphers stoc: aes256-ctr,aes256-cbc,rijndael-...@lysator.liu.se
> ,aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,chacha20-poly1...@openssh.com,blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
> [preauth]
> debug2: MACs ctos: hmac-sha2-256,hmac-sha1,hmac-sha1-96,hmac-md5,
>