Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm running an Ubuntu 12.04 ssh server/client to send files to vendors we work with. Recently I tried to add a new vendor by sending them my id_rsa.pub file, but could not connect. I've been testing this out locally and I've found that my ssh client will not connect to any new servers. The ssh client never presents the standard question i.e.

The authenticity of host x.x.x.x......... Are you sure you want to continue connecting (yes/no).

I have tried connecting to three local server all with the same negative result. All other clients can connect to these same three servers fine.

I can not connect to these servers unless I export my id_rsa.pub to their authorized_keys

If I place my public key on these servers it still fails with

Host key verification failed

never asking for a pass phrase. My work around is ssh -o StrictHostKeyChecking=no user@server. Only after I have exported my id_rsa.pub to the remote authorized_keys.

The question then is why am I never asked to add a new key to 'known_hosts' and why must I export the public key to connect?

  • I've reinstalled the ssh client, no change.
  • cleared the known_hosts file with ssh-keygen -R x.x.x.x.
  • deleted the known_hosts file.
  • cleared keychain: ran eval "$(ssh-agent)", ssh-add -D, and ssh-add.
  • for known_hosts permissions I've tried 600 and 644.

Thanks

netmgr@FTP-Inside:~/.ssh$ ssh -vvv [email protected]
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.20.11.11 [10.20.11.11] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/netmgr/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /home/netmgr/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/netmgr/.ssh/id_rsa-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/home/netmgr/.ssh/id_dsa" as a RSA1 public key
debug1: identity file /home/netmgr/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: identity file /home/netmgr/.ssh/id_dsa-cert type -1
debug1: identity file /home/netmgr/.ssh/id_ecdsa type -1
debug1: identity file /home/netmgr/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "10.20.11.11" from file "/home/netmgr/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 110/256
debug2: bits set: 496/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA a3:03:06:34:55:04:b8:71:8f:b7:65:cc:43:a5:58:43
debug3: load_hostkeys: loading entries for host "10.20.11.11" from file "/home/netmgr/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
Host key verification failed.
share|improve this question

2 Answers 2

Check if the server allows password authentication. To share your key you'll need to log on once and for that you'll need password authentication unless your key is manually added to the remote authorized_keys file at the server end as you did.

On the server end edit /etc/ssh/sshd_config to have:

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes

Restart the ssh server with sudo service ssh restart on the server.

Now send your key to the server with ssh-copy-id username@remotehost

When the key is on the remote server you can disable password authentication in /etc/ssh/sshd_config the same way you enabled it remembering to again restart ssh on the server.

share|improve this answer
    
Double checked. One server has "Yes" set the other is bounded out, which I believe is yes. Still no password challenge from either. –  user249324 Feb 18 at 21:19

SOLVED.

The global config file

/etc/ssh_config

had the following directive:

BatchMode yes

This suppresses the password challenge.

share|improve this answer

Your Answer

 
discard

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.