Question

login to Ginhub

Trying to deploy a django I constantly failed to authenticate my Github account.

I face two different issues:

  1. How to automate the Github authentication?

  2. Which password should I use?

I run:

ssh keygen
add key.pub
add agent and authenticate

In Github I:

  • added new ssh
  • generated personal token
  • switched https to ssl

On my DO server I note the file /etc/ssh/sshd_config has:

PasswordAuthentication no

#Port 22
##HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed----_key

Should I uncomment any of these?

After adding the clone git command I request to add my GitHub username and password… then it fails.

I tried with:

  • Git personal token
  • id_rsa.pub
  • pasting the actual string of the key
  • clone into Https or ssh
  • ssh -T git@github.com

I constantly fail.

I run the command to a user (not root) that was granted rights.

Any tip, advice on how to overcome this hurdle would be highly appreciated

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

In order to use SSH as your GitHub authentication method you need to do the following:

  • Check if you have an SSH key pair already, by running the following command on your server:
cat ~/.ssh/id_rsa.pub

If you do not have an SSH key pair already on your server, generate a new one with the following command: ssh-keygen.

  • Once you have your public key, copy it and then go to GitHub -> Settings -> SSH keys -> and add the public key there.

Make sure that the key is added correctly without any new lines.

Once you’ve added your SSH key there, make sure that you clone your repository with SSH and not HTTP. Your repository URL should look like this:

git@github.com:YOUR_USER/YOUR_REPO_NAME.git

You should not make any changes to the sshd_config file as this file is your SSH server configuration file for your Droplet itself and should not affect your GitHub SSH connection.

For more information on how to get started with Git I would recommend this free eBook here:

Introduction to Git and GitHub

Let me know how it goes. Best, Bobby