Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a bit lost with the error I'm getting and I'm sure someone will probably know right away what is wrong. I think we had to add new public keys to github like a month ago so I suspect it is related to that.

If I'm ssh'd into the server and do (I have the correct public_key as I'm able to ssh in):

deploy@test:~/.ssh$ ssh -T
Permission denied (publickey).

If I do:

deploy@test:~/.ssh$ ssh -vT

I get

debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA xxxxxx
debug1: Host '' is known and matches the RSA host key.
debug1: Found key in /home/deploy/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/deploy/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/deploy/.ssh/id_dsa
debug1: Trying private key: /home/deploy/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).
deploy@test:~$ ls

Do I need to delete out my authorized_keys or known_hosts?


Edit 1

I am using agent_forwarding as mentioned here: which I think should obviate the need to have keys on server.

edit 2

my local .ssh/config file

ServerAliveInterval 120
ServerAliveCountMax 3

  ForwardAgent yes

        IdentityFile ~/.ssh/id_rsa.github
share|improve this question

closed as off-topic by Dennis Kaarsemaker, Jenny D, cole, mdpc, Falcon Momot Nov 23 '13 at 10:13

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Dennis Kaarsemaker, Jenny D, cole, mdpc, Falcon Momot
If this question can be reworded to fit the rules in the help center, please edit the question.

Did you check and confirm your public key is added (and correct) to your GitHub Account? E.g. cat ~/.ssh/ Else just regenerate your keys and add them to your account – edwardmp Nov 20 '13 at 22:55
yes, so this is on the serer; access is fine from local machine. It happened origianlly from capistrano deployment. – timpone Nov 20 '13 at 23:06
Yes but is the server's contents added to GitHub? – edwardmp Nov 20 '13 at 23:06
hmm.... I don't think it needs to - I'm using agent forwarding. Or would I still need it? Should the server be the same as my local machine? – timpone Nov 20 '13 at 23:09
Yes if you use agent forwarding your own public key would be accepted. But did you setup forwarding the right way? – edwardmp Nov 20 '13 at 23:14

Just check the settings on github repository if any of these keys still exist in there:



There are 2 possibilities:

  1. Either you regenerated the keys on the server.

or 2. Somebody changed the settings on Github.

share|improve this answer
I don't need the private key on server do I? – timpone Nov 20 '13 at 23:02
Not for registering at GitHub, you just need your public key. You should NEVER share your private keys. But you do need them to be existent on the server of course. – edwardmp Nov 20 '13 at 23:07
sorry edward - should have added the agent_forwarding in above comment as I think that is relevant. my fault but still having problems. – timpone Nov 20 '13 at 23:10
One more thing I just saw on arstechnica, which I think might be related. Github is resetting user passwords following account hijack attacks :… – Sonu Bansal Nov 20 '13 at 23:52
thx Sonu - that wasn't it though :-( – timpone Nov 21 '13 at 1:56

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