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 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
  • pasting the actual string of the key
  • clone into Https or ssh
  • ssh -T

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

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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/

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:

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