🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)
🕵️ SicherheitslückenHak5: Hackers Just Poisoned the Rust Supply Chain | Threat Wire(01.09.2026 um 14:00 Uhr)
🕵️ SicherheitslückenHak5: Hackers Found a Way Into Humanoid Robots | Threat Wire(04.09.2026 um 15:04 Uhr)
🔧 AI Nachrichten Bits und so #1021 (Passwort für Laufwerk)(31.08.2026 um 22:15 Uhr)
🔧 AI Nachrichten Bits und so #1022 (Wie Weißbier)(06.09.2026 um 20:39 Uhr)
🍏 iOS / Mac OSHue-App 6.0 ist da: das sind die Neuerungen(07.09.2026 um 17:21 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

How to Set Up an SSH Key for GitHub Authentication and Commit Signing

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

If you're looking to securely connect your local Git environment to GitHub for both authentication and commit signing, using an SSH key is a great way to enhance security and streamline the process. In this article, I'll guide you step-by-step through generating an SSH key, adding it to your GitHub account, and configuring Git to use the SSH key for commit signing. This method is simpler and faster than configuring GPG keys and provides a robust solution for managing GitHub repositories.






Step 1: Generate an SSH Key



First, you need to create an SSH key pair if you don’t already have one. Open PowerShell and run the following command:




CODE
ssh-keygen -t ed25519 -C "[email protected]"








  • -t ed25519 specifies the key type (Ed25519 is a modern, secure choice).


  • -C "[email protected]" is an optional comment that helps identify the key later.



Follow the prompts:




  • Choose a location to save the key (press Enter to use the default: C:\Users\YourUsername\.ssh\id_ed25519).

  • Set a passphrase for an added layer of security (optional but recommended).



Once generated, your SSH key pair will consist of two files:





  • id_ed25519 (private key)


  • id_ed25519.pub (public key)



Important: Keep your private key secure and never share it. Only the public key (id_ed25519.pub) should be shared.






Step 2: Copy the Public Key to Your Clipboard



Next, you need to copy your public key to your clipboard so you can add it to GitHub. Run this command in PowerShell:




CODE
Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub"






This command will display your public key in the terminal. Select the entire key (starting from ssh-ed25519 and ending with your email) and copy it to your clipboard.






Step 3: Add the SSH Key to Your GitHub Account




  1. Log in to GitHub.

  2. Go to Settings by clicking your profile picture in the top right and selecting Settings.

  3. Navigate to SSH and GPG keys.

  4. Click on New SSH key.

  5. Paste your public key into the key field and give it a descriptive title (e.g., "My Work Laptop").

  6. Click Add SSH Key to save.



Now, your GitHub account is set up to recognize the SSH key for secure communication.






Step 4: Configure Git to Use Your SSH Key



To ensure that Git uses your new SSH key, you need to tell Git where to find it:




CODE
git config --global core.sshCommand "C:\\Program Files\\Git\\usr\\bin\\ssh.exe"






This command sets Git to use the ssh.exe included with Git for Windows.






Step 5: Configure Git for Commit Signing



To use the SSH key for signing your commits, you need to set up your signing key:





  1. Find the fingerprint of your SSH key by running:


    CODE
    Get-ChildItem -Path "$env:USERPROFILE\.ssh\id_ed25519.pub"





This will show the file details, but to get the actual fingerprint of your private key, use the following:




CODE
```powershell
ssh-keygen -lf "$env:USERPROFILE\.ssh\id_ed25519"
```








  1. Configure Git with your SSH key fingerprint:


    CODE
    git config --global user.signingkey YOUR_SSH_KEY_FINGERPRINT
    git config --global commit.gpgsign true



    Replace YOUR_SSH_KEY_FINGERPRINT with the fingerprint you found in the previous step.








Step 6: Tell Git Which Key to Use for Signing



If you want to specify which key Git should use for signing commits in a particular repository, navigate to that repository and run:




CODE
git config --local user.signingkey YOUR_SSH_KEY_FINGERPRINT









Step 7: Sign Your Commits



Now that everything is set up, you can create signed commits with the -S option:




CODE
git commit -S -m "Your commit message"






This ensures that your commits are signed using the SSH key, adding an extra layer of security and proving the authenticity of your changes.






Step 8: Push Your Changes to GitHub



Finally, push your commits to GitHub:




CODE
git push origin main






With the SSH key configured for both authentication and signing, your commits will be securely pushed to GitHub with the signature intact.






Key Points to Remember





  • Replace YOUR_SSH_KEY_FINGERPRINT with your actual SSH key fingerprint, which you can find by running ssh-keygen -lf "$env:USERPROFILE\.ssh\id_ed25519".


  • Ensure your private key remains secure and only the public key (id_ed25519.pub) is shared.

  • This approach streamlines Git configuration, avoiding the more complex setup associated with GPG keys.






Conclusion



By following these steps, you’ve securely set up SSH for authentication and commit signing with GitHub. This method is simpler and faster than configuring GPG and offers robust security for your codebase. Happy coding!

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
Hackers Just Poisoned the Rust Supply Chain | Threat Wire
1 Quelle
Hackers Found a Way Into Humanoid Robots | Threat Wire
1 Quelle
Bits und so #1021 (Passwort für Laufwerk)
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to Set Up an SSH Key for GitHub Authentication and Commit Signing

Thematisch verwandte Begriffe: GitHub, Authentication, Commit, Signing · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...