Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
Host github.com git 
  HostName github.com
  User git
  IdentityFile ~/.ssh/github # I've tried also /home/freinn/.shh/github

There's no /home/freinn/github file created, have I to create it?

That's the complete warning:

Warning: Identity file /home/freinn/github not accessible: No such file or directory.
Hi freinn! You've successfully authenticated, but GitHub does not provide shell access.

[freinn@freinn ruby]$ ssh -v git@github
OpenSSH_5.9p1, OpenSSL 1.0.0j-fips 10 May 2012
debug1: Reading configuration data /home/freinn/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 50: Applying options for *
ssh: Could not resolve hostname github: Name or service not known
share|improve this question

This is what is working for me:

Host github
  User git
  Hostname github.com
  IdentityFile ~/.ssh/id_rsa

The IdentityFile should point to the identify file. You can use tilde (~) which refer to a user's home directory.

So your error:

Warning: Identity file /home/freinn/github not accessible: No such file or directory.

should that this file is missing, therefore you've to create one (ssh-keygen), point to the existing DSA, ECDSA or RSA authentication identity file or use the default file (by removing or commenting out the line).

In this line: Host github, you can specify the host pattern such as alias which you want to use, so your command git@github would work. Normally you want to use one entry, or wildcard (*) to provide global defaults for all hosts.

Check further information in man ssh_config.

share|improve this answer

To get SSH authentication working for GitHub, you need to create a public/private key pair as per GitHub's instructions. The IdentityFile option should point at whatever file contains the private key you created while performing those instructions.

It looks like you're connecting just fine anyway* — you're seeing GitHub's successful connection message. Maybe your GitHub private key is just ~/.ssh/id_rsa? If so, you could remove the IdentityFile line altogether and it'll work as expected.

If it's any help, the relevant section of my ~/.ssh/config/ looks as follows:

Host github.com
    IdentityFile ~/.ssh/id_rsa_github
    IdentitiesOnly yes

…but that works only because ~/.ssh/id_rsa_github is where I put my GitHub-specific private RSA key.

*GitHub always responds with You've successfully authenticated, but GitHub does not provide shell access. when you successfuly ssh in from a shell.

share|improve this answer
    
It doesn't work. Same warning even entering "IdentitiesOnly yes" line – freinn Oct 5 '12 at 10:10
    
What is ‘it’? Deleting the IdentityFile line altogether? Copying my entry verbatim was never going to work because, as I said, it works only because ~/.ssh/id_rsa_github is where I put my GitHub-specific private RSA key. Again, it looks like you're authenticating just fine, you should be able to ditch the IdentityFile line altogether. – colons Oct 5 '12 at 10:23
    
I have to have the github file in /home/freinn/ and don't know why ssh search there... – freinn Oct 5 '12 at 10:27
    
Again, ssh is looking for and finding the relevant RSA key. You wouldn't get the You've successfully authenticated… message were that not the case. Your IdentityFile entry is almost certainly redundant, as ssh complains about it and then ultimately ignores it. If you could update your ssh -v output to git@github.com rather than git@github, we'd know for sure. But it's probably irrelevant, as getting rid of the IdentityFile line will likely stop the error message. – colons Oct 5 '12 at 10:36
    
If I quit the line IdentityFile it gives Warning: Identity file /home/freinn/github not accessible: No such file or directory. Permission denied (publickey). – freinn Oct 5 '12 at 10:48

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.