0

I'm trying to connect to my Ubuntu 14.10 server through ssh but whenever I run

ssh -p [port] [email protected]

It simply gives me no hostkey alg and drops the connection.

How can I fix it?

5
  • You need to have the public key for hostname.com. Do you have this available? If not there is no way to get this without at least a small bit of human communication (Talking to people is awful huh?). To better understand this you should look at this page Jun 16, 2015 at 20:31
  • Could you tell me the output of ls ~/.ssh? Jun 16, 2015 at 20:32
  • I have ssh_host_dsa_key, ssh_host_rsa_key, ssh_host_dsa_key.pub, ssh_host_rsa_key.pub files in /etc/ssh/ folder, I believe they are the keys you are talking about. @Grammargeek ls ~/.ssh command gave nothing
    – DarkMind
    Jun 16, 2015 at 20:38
  • Try my answer @DarkMind see if that works Jun 16, 2015 at 20:48
  • 2
    possible duplicate of ssh refusing connection with message "no hostkey alg"
    – heemayl
    Jun 16, 2015 at 20:53

1 Answer 1

-1

Running sudo apt-get purge openssh-server and then running sudo apt-get install openssh-server should fix your problem

33
  • What do I add instead of known_hosts ?
    – DarkMind
    Jun 16, 2015 at 20:48
  • Nothing you leave it the way it is and it must be ~/.ssh Jun 16, 2015 at 20:48
  • you can try putting it in /etc/ssh but I don't think it will work Jun 16, 2015 at 20:49
  • Ok, after I tried it, here is what I got: ipsissimus$ echo $(ssh-keyscan -t rsa myhostname.com) >> ~/.ssh/known_hosts # myhostname.com SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 no hostkey alg
    – DarkMind
    Jun 16, 2015 at 20:50
  • try then running echo $(ssh-keyscan -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -t rsa myhostname.com) >> ~/.ssh/known_hosts Jun 16, 2015 at 20:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .