How to git pull from public repo via ssh without a key?

I just tried it without key, and I confirm it cannot work (without SSH key):

$ git clone [email protected]:rlpowell/config.git
Cloning into 'config'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

That is because GitHub won’t authorize anonymous access through SSH (as opposed to https), as other git repo servers decided to do (like Gogits or go-gitea)

GitHub does mention:

SSH URLs provide access to a Git repository via SSH, a secure protocol.
To use these URLs, you must generate an SSH keypair on your computer and add the public key to your GitHub account.

(emphasis on must)

Why? (asked in 2015). While sshd can be configured to allow anonymous access, no public site would ever consider setting this up: it is too big of a security risk.

needs to work without a specific key

If you need anonymous access, you can use:

  • an https URL
  • a git URL: git://github.com/<user>/<repo>, although it uses the port 9418, which is often blocked in an enterprise environment.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)