Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My SSH connections worked well, but from last week SSH from my laptop to my board refusing connection. I can make a SSH connection from the board to laptop, but not vice-versa. I tried that with my user and root user and had same issue.

My Laptop is an Ubuntu 12.10 and my board is a Debian 6.

Here is the verbose output of SSH:

danialbehzadi@danial-HP:~$ ssh -v  
OpenSSH_5.2p1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to [] port 22.
debug1: Connection established.  
debug1: identity file /home/danialbehzadi/.ssh/identity type -1  
debug1: identity file /home/danialbehzadi/.ssh/id_rsa type 1  
debug1: identity file /home/danialbehzadi/.ssh/id_dsa type -1  
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4  
debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH*  
debug1: Enabling compatibility mode for protocol 2.0  
debug1: Local version string SSH-2.0-OpenSSH_5.2  
debug1: SSH2_MSG_KEXINIT sent  
debug1: SSH2_MSG_KEXINIT received  
debug1: kex: server->client aes128-ctr hmac-md5 none  
debug1: kex: client->server aes128-ctr hmac-md5 none  
no hostkey alg
share|improve this question
up vote 7 down vote accepted

I made new rsa and dsa keys on the board and it went OK:

~# ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
~# ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
share|improve this answer
On a related note, When I tried to connect from dropbear ssh (common on android) to cygwin's sshd, I got "no matching algo hostkey". The server was set to accept key and password so it should've gone to password if the key fails. So I think this solution might not work for some.. According to this link it's to do with the encryption algorithm used but no solution mentioned there. – barlop Sep 5 '14 at 10:57
We had the same problem with a ubuntu server 14.04. After trying to start a new instance of ssh server in debug mode, we found that private keys on the server did not have 0600 permission, once we fixed that and restarted the server, everything started working ok. – Awi Jul 10 '15 at 20:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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