How to fix warning: Identity file github not accessible: No such file or directory?

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

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.

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like