0

Testing your SSH connection

  • Step1.1 ssh -T git@github.com Hi githubname! You've successfully authenticated, but GitHub does not provide shell access.

  • Step1.2 ssh-add -l -E md5 4096 MD5:6b:4f:0e:27:d8:8f:e5:89:c7:15:71:2d:60:d1:e6:ef /home/username/.ssh/id_rsa (RSA)

clone from github

  • Step2
    sudo git clone --recursive git@github.com:skilion/onedrive.git

    Cloning into 'onedrive'...
    Permission denied (publickey).
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.

Reference GitHub Error Message - Permission denied (publickey)

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
MarsForever
  • 21
  • 1
  • 6

1 Answers1

0

You appear to be running git with sudo, and therefore using the root user's SSH credentials. Try running it without sudo, or clone from the HTTPS url, like so:

# SSH URL (using your credentials)
git clone --recursive git@github.com:skilion/onedrive.git

# HTTPS URL (public repo, so no creds needed)
# The 'sudo' here is likely optional, and should only be used if you really know you need it
sudo git clone --recursive https://github.com/skilion/onedrive.git

Hope this helps!

HeroCC
  • 988
  • 15
  • 33