I have two Linux servers CentOS 7 & Debian 6 running a vulnerable web app inside virtual Box, my host OS is Kali Linux & connected to both VM'S with Host -only -adapter settings. i can successfully SSH to CentOS, but when i SSH to Debian it says Host verification failed, my question was how to ssh to debian without getting error or connect to more than one vm ?

" apologies for not providing enough info earlier" as requested i have the details


Host *
#   ForwardAgent no
#   ForwardX11 no
#   ForwardX11Trusted yes
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   GSSAPIKeyExchange no
#   GSSAPITrustDNS no
#   BatchMode no
#   -o CheckHostIP no
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking no
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com

#   RekeyLimit 1G 1h
    SendEnv LANG LC_*
    HashKnownHosts yes
    GSSAPIAuthentication yes
    GSSAPIDelegateCredentials no
    NoHostAuthenticationForLocalhost yes


# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin without-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server`enter code here`
  • 1
    connect using console and investigate the issue. If you are not able to authenticate with valid key or password, than there is no way to go by this channel (it is called secure). And please provide full error you get.
    – Jakuje
    Jan 25 '16 at 17:17

you have two options:

  • add -o "CheckHostIP no" option to ssh command line;
  • add the following snipplet to your ~/.ssh/config file:

Host ip-address-of-your-VM

CheckHostIP no


Did i get it right from your update, that the file you have in your ~/.ssh directory is named ssh_config? If this is true, you did a mistake: it should be named just config (without ssh_)

In the config you posted you have a line that you obviously add:

#   -o CheckHostIP no

It should look completely different:

CheckHostIP no

And preferably put these two lines at very end of you config file so the entry for your VM host derives all other settings you have set.

  • i did it but i don't know where i made mistake its still gives same error, here's my file inside ssh_config # -o CheckHostIP no Jan 25 '16 at 15:20
  • Could you update your question with the cut&paste copy of your config file, please use 'code sample' button to keep all formatting. Thank you
    – Serge
    Jan 25 '16 at 19:28
  • check question its updated Jan 26 '16 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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