Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ Streamlined Guide: Setting Up SSH and GPG Keys onย GitHub


๐Ÿ“š Streamlined Guide: Setting Up SSH and GPG Keys onย GitHub


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

Image description

Both SSH keys and GPG serve its purposes heres how! ๐Ÿค“

SSH is more streamline and common to set up to commit your code without entering your username and password when commiting to repo. When generating an SSH key pair on your local machine and adding the public key to your Github account settings, you can easily authenticate securly without transmiting sensitive information over the network.

GPG stands for GNU Privacy Guard used to sign your Git commits to provide that the commits are signed by you. It comes more of an essense to use if you are freelancing and working with open source projects. In Github it would then display "Verified" badge next to your commits. In open source contribution GPG is often involved in Github Actions to verify users commits and provides assurance that commits are authentic.

In this turtorial we will use WSL(Windows Subsystem for Linux) Mac would be fine as well. We will start of setting SSH then continue on with GPG.

Setting upย SSH

To be sure you should be aware that you dont have already existing SSH keys.

ls -al ~/.ssh

From own experience I did have but switched my laptop and SSH didnt back up.

Hint: You can always just copyย .ssh folder manually and save it elsewhere or save it in drive to later add the folder in your new machine so you wont have to recreate it!

ssh-keygen -t rsa -b 4096 -C "[email protected]"

In above example we create ssh-keygen 4096 is amount of bits included(the longer more secure it is). The email is optional but recomented as it adds additional context of the key's purpose of ownership.

Image description

One think to note of above example I have canceled SSH creation if it's your first time continue BUT if SSH was already added in Github overwriting can cause issues:

  1. Authentication with a remote server
  2. Having revoked access to certain repos the old one was permited
  3. Security risks

Next run _*eval $(ssh-agent -s) *_is to start the SSH agent and set up the necessary environment.

ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub

Following that add it to your defaultย .ssh folder and then just display it with the linux cat command. ๐Ÿˆ

Image description

Go to the bellow link

https://github.com/settings/keys

Add your SSH and if you please can test in your terminal with command
ssh -T [email protected] that will attemt to connect to Github using SSH. When generating GPG key you will be as well promoted to add a passfraze or not I did but that is for security purposes.

Image description
A tad more steps then SSH key gen but it is what it is.

Unlike SSH we have to use gpg command to view the GPG key by typing ๐Ÿ‘‡

gpg --list-secret-keys --keyid-format LONG
//then get the full PGP content
gpg --armor --export <GPG-ID>

Image description

Copy the GPG key with begin and end block and add it at same path as SSH keys just in it's corresponding field link you can find here as well.

Lastly you can tell GIt to sign your commits using your GPG key(it will not interfier with SSH in majority of cases).

git config --global user.signingkey <your_gpg_key_id>

your GPG Key ID is sec section after runningโ€Š-โ€Šlist-secret-keys command the one after / sec rsa3072/.

When that is done on your git commits use -S flag to use signing commits.

git commit -S -m "Your first commit with GPG key!"

That is basically it remember to not aimlessly replace existing SSH or GPG keys maybe they are listed somewhere in your machine just not in right directory.ย 

In addition using Github Desktop is convinient and easy but I wasn't able to do sign in commits with GPG so sometimes convienient way is not always the best and can cause conficts and issues.

...



๐Ÿ“Œ Streamlined Guide: Setting Up SSH and GPG Keys onย GitHub


๐Ÿ“ˆ 79.72 Punkte

๐Ÿ“Œ gpg-tui v0.6.0 release - supports importing GPG keys from the clipboard


๐Ÿ“ˆ 44.4 Punkte

๐Ÿ“Œ Two malicious Python libraries caught stealing SSH and GPG keys (ZDNet)


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Two malicious Python libraries were stealing SSH and GPG keys


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Two Malicious Python Libraries Caught Stealing SSH and GPG Keys


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Two malicious Python libraries caught stealing SSH and GPG keys | ZDNet


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Two Malicious Python Packages Steal SSH and GPG Keys Exists in the Python Package Index for a Year


๐Ÿ“ˆ 37.45 Punkte

๐Ÿ“Œ Setting up SSH Keys for Github, GitLab, and Bitbucket in one windows pc


๐Ÿ“ˆ 36.1 Punkte

๐Ÿ“Œ Unqiue pair of SSH/GPG keys or multiple ones?


๐Ÿ“ˆ 35.93 Punkte

๐Ÿ“Œ GNOME gnome-keyring 3.4.0/3.4.1 gkd-gpg-agent-ops.c gpg-cache-method idle/timeout access control


๐Ÿ“ˆ 35.18 Punkte

๐Ÿ“Œ How to install GPG (gnupg2) on a Debian Linux to fix gpg command not found error


๐Ÿ“ˆ 35.18 Punkte

๐Ÿ“Œ Setting up SSH Keys on Mac for Github


๐Ÿ“ˆ 34.57 Punkte

๐Ÿ“Œ Convert X.509 PEM/DER certificates and GPG keys to JSON or YAML for easier parsing in scripts with JC


๐Ÿ“ˆ 28.34 Punkte

๐Ÿ“Œ Simplify Your Dev Life with Git, SSH & GPG: How to Work with Multiple Code Hosts and Sign Your Commits with Ease


๐Ÿ“ˆ 28.22 Punkte

๐Ÿ“Œ How do you stay up to date on SSH, GPG, TLS algorithms and ciphers?


๐Ÿ“ˆ 28.22 Punkte

๐Ÿ“Œ How do you stay up to date on SSH, GPG, TLS algorithms and ciphers?


๐Ÿ“ˆ 28.22 Punkte

๐Ÿ“Œ New SSH-Snake malware steals SSH keys to spread across the network


๐Ÿ“ˆ 27.45 Punkte

๐Ÿ“Œ ssh-context - Bash wrapper around ssh which provides you ability to use contexts (as in kubectl) for SSH.


๐Ÿ“ˆ 27.33 Punkte

๐Ÿ“Œ Understanding Primary Keys and Foreign Keys in SQL: A Simple and Detailed Guide


๐Ÿ“ˆ 27.29 Punkte

๐Ÿ“Œ Dealing with expired GPG keys in Linux package management


๐Ÿ“ˆ 26.82 Punkte

๐Ÿ“Œ New Tool Helps Group Members Synchronize GPG Keys Among Each Other


๐Ÿ“ˆ 26.82 Punkte

๐Ÿ“Œ New Tool Helps Group Members Synchronize GPG Keys Among Each Other


๐Ÿ“ˆ 26.82 Punkte

๐Ÿ“Œ Python: Trojanisierte Bibliotheken stehlen SSH- und GPG-Schlรผssel


๐Ÿ“ˆ 26.7 Punkte

๐Ÿ“Œ Sign Git Commits and Authenticate to GitHub with SSH Keys


๐Ÿ“ˆ 26.64 Punkte

๐Ÿ“Œ Setting up GitHub SSH on Linux


๐Ÿ“ˆ 25.35 Punkte

๐Ÿ“Œ GitHub now supports security keys when using Git over SSH


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Security keys are now supported on Github for SSH Git operations


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Git SSH Keys: Privates GitHub Repository nutzen (klonen, pushen, etc.)


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Verwendung eines SSH-Keys mit GitHub


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Github publishes RSA SSH host keys by mistake, issues update


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Malicious NPM Packages Exfiltrate Hundreds of Developer SSH Keys via GitHub


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Hackers Deploy Malicious npm Packages on GitHub to Steal SSH Keys


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Malicious npm Packages Used to Target GitHub Developer SSH Keys


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ How to Manage Multiple SSH Keys for Different GitHub Accounts


๐Ÿ“ˆ 25.11 Punkte

๐Ÿ“Œ Setup Github SSH keys (for linux)


๐Ÿ“ˆ 25.11 Punkte











matomo