Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More on SSHD [SOLVED] #1084

Closed
iz0eyj opened this issue Sep 15, 2016 · 4 comments
Closed

More on SSHD [SOLVED] #1084

iz0eyj opened this issue Sep 15, 2016 · 4 comments

Comments

@iz0eyj
Copy link

iz0eyj commented Sep 15, 2016

Hi,
on the last build 14926 (I'm testing Xenial) the sshd starts without errors, but is impossible to connect because it kills the connection.
This is the debug if I try to connect WSL side from Win side using Putty.

federico@Bestia:~/.ssh$ sudo /usr/sbin/sshd -d
debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g-fips 1 Mar 2016
debug1: private host key #0: ssh-rsa SHA256:4/+AwrJXQa8j1xlpQKrumig/dS7qYbsfD1lnpQ8BAkY
debug1: private host key #1: ssh-dss SHA256:VxOUVbEOLTzHyH4LzIYMYlEmos/kUj6NPyhZjncnuRA
debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:KmxxQj//PiHC0JQwfa7pSwevEclSxjo9J4387sSv4JM
debug1: private host key #3: ssh-ed25519 SHA256:gwVzNBu5KSpftqaCzLgIXhsOcd7eG6TWCNiLM6sckUc
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Bind to port 22 on ::.
Bind to port 22 on :: failed: Address already in use. I THINK YOU CAN IGNORE THIS

AT THIS POINT THE SSH SERVER IS UP AND I START CONNECT IT FROM PUTTY

debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug1: inetd sockets after dupping: 3, 3
Connection from 127.0.0.1 port 5261 on 127.0.0.1 port 22
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.67
debug1: no match: PuTTY_Release_0.67
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
chroot("/var/run/sshd"): Function not implemented [preauth]

debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: Killing privsep child 4572
debug1: audit_event: unhandled event 12
federico@Bestia:~/.ssh$

@aseering
Copy link
Contributor

Hi @iz0eyj -- for what it's worth, I think I remember some discussion somewhere about needing to modify /etc/ssh/sshd_config to disable the chroot(). Unfortunately, I can't seem to find that discussion...

@iz0eyj
Copy link
Author

iz0eyj commented Sep 15, 2016

@aseering Many thanks for answer, I found it (#300).
The suggested workarond "change UsePrivilegeSeparation to no in /etc/ssh/sshd_config" seems good.
Now I have some problem with keys:

debug1: sshd version OpenSSH_7.2, OpenSSL 1.0.2g-fips 1 Mar 2016
debug1: key_load_private: No such file or directory
debug1: key_load_public: No such file or directory
Could not load host key: /etc/ssh/ssh_host_key
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-f'
debug1: rexec_argv[2]='/etc/ssh/ssh_config'
debug1: rexec_argv[3]='-d'
debug1: Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 127.0.0.1.
Server listening on 127.0.0.1 port 22.
debug1: Server will not fork when running in debugging mode.
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug1: inetd sockets after dupping: 3, 3

Connection from 127.0.0.1 port 12511 on 127.0.0.1 port 22
debug1: Client protocol version 2.0; client software version PuTTY_Release_0.67
debug1: no match: PuTTY_Release_0.67
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: list_hostkey_types:
No supported key exchange algorithms
debug1: do_cleanup
debug1: audit_event: unhandled event 12
federico@Bestia:/etc/ssh$

@aseering
Copy link
Contributor

@iz0eyj -- hm... It sounds like you don't have an ssh host key for some reason. Normally those are generated when the openssh package is installed. Maybe it didn't finish installing correctly? If you run sudo apt-get -f install, does it try to finish installing any packages?

You could also try regenerating the host key. Various places online have instructions for doing that; for example:
http://www.cyberciti.biz/faq/howto-regenerate-openssh-host-keys/

@iz0eyj
Copy link
Author

iz0eyj commented Sep 15, 2016

@aseering ok, all works now, something wrong during the first sshd installation.
Many thanks for your suggestion, for me sshd is important to use VisualGDB.

@iz0eyj iz0eyj closed this as completed Sep 15, 2016
@iz0eyj iz0eyj changed the title More on SSHD More on SSHD [SOLVED] Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants