Host key verification failed with SSH

jeff

I'm trying to connect to my computer via OpenSSH on Ubuntu (either remotely or from the same machine, different terminal), however none works. When I try to connect remotely with ssh username@ip_address the terminal keeps waiting but nothing happens. When I try to connect from the same machine with ssh -v localhost, I get the following output and error:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'me'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ybhcdw75C5wG/KnILBWaRnIA+NH8kGBFbi8yUIbUhl0
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:ybhcdw75C5wG/KnILBWaRnIA+NH8kGBFbi8yUIbUhl0.
Are you sure you want to continue connecting (yes/no)? 
Host key verification failed.

How can I solve this issue? I tried to turn password authentication off, to get the least secure but usable setup, but still no luck.

Update:

I generated keys and now I get a different error with ssh -v localhost, as follows:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/me/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to localhost:22 as 'me'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:ybhcdw75C5wG/KnILBWaRnIA+NH8kGBFbi8yUIbUhl0
debug1: Host 'localhost' is known and matches the ECDSA host key.
debug1: Found key in /home/me/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/me/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/me/.ssh/id_dsa
debug1: Trying private key: /home/me/.ssh/id_ecdsa
debug1: Trying private key: /home/me/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

Any help would be appreciated. Thanks,

mimi.vx

first thing :

Have you generated own ssh keys ?

debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/me/.ssh/id_ed25519-cert type -1

this says no public and secret key found..

Plus almost every distribution has now enabled StrictHostChecking = yes in /etc/ssh/ssh_config + allowed only ssh2 protocol ( btw. ssh1 allowing ssh1 is dangerous and totally unsecure)

And last have you allowed interactive login or only public key auth ?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SSH 'Host key verification failed' error

From Dev

"Host key verification failed"?

From Dev

SSH connection problem with "Host key verification failed..." error

From Dev

SSH connection problem with "Host key verification failed..." error

From Dev

Git push fails because of ssh key: Host key verification failed. from inside a docker

From Dev

Not able to "git pull" - Host key verification failed

From Dev

Team City Git "Host key verification failed"

From Dev

Heroku composer install: Host key verification failed

From Dev

Host key verification failed using gitlab and jenkins

From Dev

Host key verification failed.#015

From Dev

Ignore SSH host key verification for a subnet

From Dev

rsync + rsync failed because Host key verification failed

From Java

Git error: "Host Key Verification Failed" when connecting to remote repository

From Dev

Deja-dup failing with "Host key verification failed"

From Dev

Deja-dup failing with "Host key verification failed"

From Dev

Host key verification failed (exit code 255) while using pdcp

From Dev

host key verification failed when I use scp

From Dev

Host key verification failed using mpi4py

From Dev

Can't install @types packages: Host key verification failed

From Dev

"Host key verification failed" during docker alpine 9 build

From Dev

Ansible with host_key_checking set to false fails with "Host key verification failed."

From Dev

Connect to ssh without Host Key Verification using j2ssh maverick

From Dev

Jenkins pipeline: scp tries to copy to other remote, Host key verification failed

From Dev

Connection to EC2 instance from Jenkins fails : Host key verification failed

From Dev

SSH host key keeps changing

From Dev

SSH host key keeps changing

From Dev

Why does Akismet return failed on key verification?

From Dev

SSH failed public key authentication

From Dev

Error: Failed to connect to the host via ssh

Related Related

  1. 1

    SSH 'Host key verification failed' error

  2. 2

    "Host key verification failed"?

  3. 3

    SSH connection problem with "Host key verification failed..." error

  4. 4

    SSH connection problem with "Host key verification failed..." error

  5. 5

    Git push fails because of ssh key: Host key verification failed. from inside a docker

  6. 6

    Not able to "git pull" - Host key verification failed

  7. 7

    Team City Git "Host key verification failed"

  8. 8

    Heroku composer install: Host key verification failed

  9. 9

    Host key verification failed using gitlab and jenkins

  10. 10

    Host key verification failed.#015

  11. 11

    Ignore SSH host key verification for a subnet

  12. 12

    rsync + rsync failed because Host key verification failed

  13. 13

    Git error: "Host Key Verification Failed" when connecting to remote repository

  14. 14

    Deja-dup failing with "Host key verification failed"

  15. 15

    Deja-dup failing with "Host key verification failed"

  16. 16

    Host key verification failed (exit code 255) while using pdcp

  17. 17

    host key verification failed when I use scp

  18. 18

    Host key verification failed using mpi4py

  19. 19

    Can't install @types packages: Host key verification failed

  20. 20

    "Host key verification failed" during docker alpine 9 build

  21. 21

    Ansible with host_key_checking set to false fails with "Host key verification failed."

  22. 22

    Connect to ssh without Host Key Verification using j2ssh maverick

  23. 23

    Jenkins pipeline: scp tries to copy to other remote, Host key verification failed

  24. 24

    Connection to EC2 instance from Jenkins fails : Host key verification failed

  25. 25

    SSH host key keeps changing

  26. 26

    SSH host key keeps changing

  27. 27

    Why does Akismet return failed on key verification?

  28. 28

    SSH failed public key authentication

  29. 29

    Error: Failed to connect to the host via ssh

HotTag

Archive