If you encounter the error Permission denied (publickey) when you try to connect to your GitHub Enterprise instance via SSH, you may need to explicitly specify which private SSH key to use.

Using a command-line option

Run ssh with the -i argument as follows:

ssh -i /path/to/ghe_private_key admin@hostname

Using an SSH config file

Add the following lines to your SSH config (~/.ssh/config):

Host hostname
  IdentityFile /path/to/ghe_private_key
  User admin

Once you have configured the private key and username for your GitHub Enterprise installation, you should be able to SSH into it as the admin user with the following command:

ssh hostname