9
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
0

2 Answers 2

2

This is what is working for me:

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

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

Basically the error:

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

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

Also, in the host line (Host github), you can specify the host pattern such as alias which you want to use, so you can use git@github instead of using full host. Normally you want to use specific host entry, however you can also use a wildcard character (*) which will apply global settings for all hosts.

Check further information by running man ssh_config command.

1

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.

7
  • It doesn't work. Same warning even entering "IdentitiesOnly yes" line
    – freinn
    Oct 5, 2012 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, 2012 at 10:23
  • I have to have the github file in /home/freinn/ and don't know why ssh search there...
    – freinn
    Oct 5, 2012 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 [email protected] 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, 2012 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, 2012 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .