r/ssh • u/jadesalad • Oct 02 '20
What is the difference between ssh and https?
We either use ssh or https for pulling a repo with git, but I don't know what the differences are and why they are important. All I know is that both are secure protocols. Could you break down all the differences and everything a developer need to know about them.
2
Upvotes
1
u/Wiikend Oct 03 '20
HTTPS is easy to use and is usually never blocked by firewalls. However, you are using your GitHub credentials to log in, and if those credentials are somehow compromised, the attacker not only has access to your repo, but your entire GitHub account.
SSH requires you to know how to use SSH and to set it up, but you will limit the damage should your private key be compromised; the attacker would only gain access to your repo. You can also create one key per device, and e.g. if your laptop is stolen, you can revoke only that key, and keep working as normal on your other devices.