I want to run SSHd on my raspberry device on two ports. I've added

Port 22
Port 5500

to /etc/ssh/sshd_config, and ran /etc/init.d/ssh restart.

Problem is, that connection on port 5500 is always reset.

I can see possible problem here: (it is listening as user pi). not sure how can this happen.

> lsof -i
sshd     7727   pi    3u  IPv4  13512      0t0  TCP *:5500 (LISTEN)
sshd     8122 root    3u  IPv4  15032      0t0  TCP *:ssh (LISTEN)

Also, other outputs:

> ssh localhost -p 5500 -v
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2
debug1: SSH2_MSG_KEXINIT sent
Read from socket failed: Connection reset by peer

from /var/log/auth.log

> tail /var/auth/auth.log
Dec  1 18:01:18 usoplesk sshd[8297]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec  1 18:01:18 usoplesk sshd[8297]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Dec  1 18:01:18 usoplesk sshd[8297]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec  1 18:01:18 usoplesk sshd[8297]: fatal: No supported key exchange algorithms [preauth]

I assume the issue is in wrong user sshd is listening with, but I cannot find any configuration to change this.

ssh on port 22 works as usual.

migrated from serverfault.com Dec 1 '14 at 17:05

This question came from our site for system and network administrators.

up vote 5 down vote accepted

Looks to me as if you didn't stop the original sshd service before starting the new one. The new one was not started with root privileges, tried to allocate port 22 and failed and just allocated port 5500.

Check the starting times with

ps -ef | grep sshd

Don't know your OS but start looking for

sudo service OpenSSH status

or

sudo /etc/init.d/ssh status
  • 2
    Thanks! the restart command did not stop old sshd, after killing it (+ /etc/init.d/ssh start), everything works. – nothrow Dec 1 '14 at 17:22

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.