Why git authentications works through SSH keys?

Question in the title, but let me detail more. Excluding the ID/Password method on git CLI, we generate a SSH key and add the public key to the remote server. Why don’t we have SSH-less public-key cryptography methods? We are not even connecting to remote a machine’s terminal, we don’t even need to connect a remote machine’s terminal (do we?), so why is it named as SSH key? Is it just about naming convention, or something else? What is the history behind that?

Asked By: brm1911


As one StackOverflow answer says (mentioned in a comment), early in Git’s history the ssh protocol had the benefits of supporting both read and write access to the backend repo, as well as cryptographically strong authentication and encryption.

Another benefit of ssh is it allows managing/replacing the keys independently of your deploy software. I.e., your deploy scripts don’t have to know how to read the auth token from somewhere and and deliver it to the server.

There certainly are other protocols with comparable functionality, but these are among the reasons that git+ssh became so widely used over the past 10+ years.

Answered By: Sotto Voce
Categories: Answers Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.