My issue is that I can't ssh
agains the hostname
, during troubleshooting I did a host look up and tried to ssh via IP which worked.
The error message I get is...
Permission denied (publickey).
ssh_exchange_identification: Connection closed by remote host
Which would describe a key mismatch which I was able to confirm matched by consoling into the sever directly. I had someone with access manually push the key to one server which seemed to resolve the issue however I need to access over 300 servers via ansible. My guess is git commit
or whatever (super new with no clue :/) is having an issue. Any suggestions what could be the problem.
the output:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/<user>/.ssh/config
debug1: /Users/<user>a/.ssh/config line 1: Applying options for *.<server>
debug1: /Users/<user>/.ssh/config line 13: Applying options for *.<server>
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: /etc/ssh_config line 102: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/tmp/ssh-<user>@<server>:<port>" does not exist
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec ssh <proxy server name> nc -w 120 <server name> <port>
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/<username>/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/<username>/.ssh/id_rsa type 1
debug1: identity file /Users/<username>/.ssh/id_rsa-cert type -1
debug1: identity file /Users/<username>/.ssh/id_dsa type -1
debug1: identity file /Users/<username>/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: permanently_drop_suid: 501
debug1: Local version string SSH-2.0-OpenSSH_6.2
Permission denied (publickey).
ssh_exchange_identification: Connection closed by remote host
To provide an update, the issue doesn't seem to be related to my key after all. It seems to be related to my local system(mac OS 10.10.4) After my keys were properly pushed to the server contained in my ~/.ssh/config
file I can SSH and connect to the servers in question. However I still cannot from local system. I can however SSH via IP, I believe this is a dns issue...maybe need to flush? FW is disabled.
ssh: connect to host port 3422: Connection refused
When I connect to one of the servers in question, my key matches what is located under ~/.ssh/authorized_key
, in regards to GitHub, I add it there where in turn I BELIEVE gets pushed to all server via Ansible.
hostaname
andifconfig
Also are you using a "sudo" before the command?