Skip to content

Instantly share code, notes, and snippets.

@dennis-gonzales
Last active March 5, 2025 00:19
Show Gist options
  • Save dennis-gonzales/87b367d158ff17ac65d9ac018ed8e0da to your computer and use it in GitHub Desktop.
Save dennis-gonzales/87b367d158ff17ac65d9ac018ed8e0da to your computer and use it in GitHub Desktop.

Revisions

  1. dennis-gonzales revised this gist Mar 5, 2025. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -84,7 +84,7 @@ Host z1
    [gpg]
    format = ssh # git config --global gpg.format ssh
    [commit]
    gpgsign = true # git config commit.gpgsign true
    gpgsign = true # git config --global commit.gpgsign true
    # Custom Git Profile for Directory Google
    [includeIf "gitdir:~/Workstation/Google/"]
  2. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -137,7 +137,7 @@ ssh -T [email protected]

    ### Troubleshooting

    1. Ensure **local-agent** ssh is running `echo "$SSH_AUTH_SOCK"`
    1. Ensure local **ssh-agent** is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to **ssh-agent** `ssh-add -L`
    3. If the command says that **no identity is available**, you'll need to add your key: `ssh-add YOUR-KEY`

  3. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -137,8 +137,8 @@ ssh -T [email protected]

    ### Troubleshooting

    1. Ensure *local-agent* ssh is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to *ssh-agent* `ssh-add -L`
    3. If the command says that *no identity is available*, you'll need to add your key: `ssh-add YOUR-KEY`
    1. Ensure **local-agent** ssh is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to **ssh-agent** `ssh-add -L`
    3. If the command says that **no identity is available**, you'll need to add your key: `ssh-add YOUR-KEY`

    [Using SSH agent forwarding](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/using-ssh-agent-forwarding)
  4. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -137,8 +137,8 @@ ssh -T [email protected]

    ### Troubleshooting

    1. Ensure local ssh is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to ssh-agent `ssh-add -L`
    3. If the command says that no identity is available, you'll need to add your key: `ssh-add YOUR-KEY`
    1. Ensure *local-agent* ssh is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to *ssh-agent* `ssh-add -L`
    3. If the command says that *no identity is available*, you'll need to add your key: `ssh-add YOUR-KEY`

    [Using SSH agent forwarding](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/using-ssh-agent-forwarding)
  5. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -113,6 +113,8 @@ Host x.x.x.x
    ForwardAgent yes
    ```

    ssh to server via: `ssh -i ~/.ssh/example_rsa [email protected]`

    ### Configure user and identity file

    ```
  6. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -113,7 +113,7 @@ Host x.x.x.x
    ForwardAgent yes
    ```

    ### Configure user and dentity file
    ### Configure user and identity file

    ```
    Host x.x.x.x
  7. dennis-gonzales revised this gist Dec 22, 2024. No changes.
  8. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -108,11 +108,22 @@ git cat-file -p HEAD

    ## Allow agent forwarding

    ```bash
    Host example.com # or x.x.x.x
    ```
    Host x.x.x.x
    ForwardAgent yes
    ```

    ### Configure user and dentity file

    ```
    Host x.x.x.x
    User dennis
    IdentityFile ~/.ssh/example_rsa
    ForwardAgent yes
    ```

    you can now just do: `ssh x.x.x.x`

    ## Testing SSH agent forwarding

    ```bash
  9. dennis-gonzales revised this gist Dec 22, 2024. 1 changed file with 30 additions and 3 deletions.
    33 changes: 30 additions & 3 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -47,7 +47,7 @@ ssh-add -L # full key in OpenSSH format

    # Setting up SSH with Git

    ### Example config file for managing SSH profiles
    ## Example config file for managing SSH profiles
    // ~/.ssh/config
    ```
    Host github.com
    @@ -95,10 +95,37 @@ Host z1

    ### Show detailed information of the latest commit on the current branch including the `gpgsig`

    ```
    ```bash
    git cat-file -p HEAD
    ```

    [Telling Git about your SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)

    [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
    [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)


    # Setting up SSH agent forwarding

    ## Allow agent forwarding

    ```bash
    Host example.com # or x.x.x.x
    ForwardAgent yes
    ```

    ## Testing SSH agent forwarding

    ```bash
    echo "$SSH_AUTH_SOCK"

    # try to ssh to github
    ssh -T [email protected]
    ```

    ### Troubleshooting

    1. Ensure local ssh is running `echo "$SSH_AUTH_SOCK"`
    2. Key must be visible to ssh-agent `ssh-add -L`
    3. If the command says that no identity is available, you'll need to add your key: `ssh-add YOUR-KEY`

    [Using SSH agent forwarding](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/using-ssh-agent-forwarding)
  10. dennis-gonzales revised this gist Nov 10, 2024. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -89,9 +89,16 @@ Host z1
    # Custom Git Profile for Directory Google
    [includeIf "gitdir:~/Workstation/Google/"]
    path = ~/.google.gitconfig
    ```

    ### Show detailed information of the latest commit on the current branch including the `gpgsig`

    ```
    git cat-file -p HEAD
    ```

    [Telling Git about your SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)

    [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
  11. dennis-gonzales revised this gist Feb 13, 2024. No changes.
  12. dennis-gonzales revised this gist Feb 13, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -41,9 +41,9 @@ ssh-add -l # list by fingerprint
    ssh-add -L # full key in OpenSSH format
    ```

    [Similar guide 1](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
    [Generating a new SSH key w/ ssh-agent](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    [Similar guide 2](https://aaneloy.github.io/Github-SSH-windows-11/)
    [Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/)

    # Setting up SSH with Git

  13. dennis-gonzales revised this gist Feb 13, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -93,4 +93,5 @@ Host z1
    ```

    [Telling Git about your SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)

    [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
  14. dennis-gonzales revised this gist Feb 13, 2024. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ Host z1
    ```

    ## Custom git user on different project folder ([readmore](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key))
    ## Custom git user on different project folder
    // ~/.google.gitconfig
    ```
    [user]
    @@ -92,3 +92,5 @@ Host z1
    ```

    [Telling Git about your SSH key](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key)
    [Signing commits](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
  15. dennis-gonzales revised this gist Feb 13, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -65,7 +65,7 @@ Host z1
    ```

    ## Custom git user on different project folder
    ## Custom git user on different project folder ([readmore](https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-ssh-key))
    // ~/.google.gitconfig
    ```
    [user]
  16. dennis-gonzales revised this gist Feb 13, 2024. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -71,6 +71,7 @@ Host z1
    [user]
    email = [email protected]
    name = dnnsgnzls
    signingkey = ~/.ssh/google_rsa.pub # git config user.signingkey /PATH/TO/.SSH/KEY.PUB
    ```

    // ~/.gitconfig
    @@ -79,6 +80,11 @@ Host z1
    [user]
    name = Dennis Gonzales
    email = [email protected]
    signingkey = ~/.ssh/personal_rsa.pub # git config --global user.signingkey /PATH/TO/.SSH/KEY.PUB
    [gpg]
    format = ssh # git config --global gpg.format ssh
    [commit]
    gpgsign = true # git config commit.gpgsign true
    # Custom Git Profile for Directory Google
    [includeIf "gitdir:~/Workstation/Google/"]
  17. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -80,8 +80,8 @@ Host z1
    name = Dennis Gonzales
    email = [email protected]
    # Custom Git Profile for Directory Z1
    [includeIf "gitdir:~/Workstation/google/"]
    # Custom Git Profile for Directory Google
    [includeIf "gitdir:~/Workstation/Google/"]
    path = ~/.google.gitconfig
    ```
  18. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 10 additions and 3 deletions.
    13 changes: 10 additions & 3 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -66,7 +66,7 @@ Host z1
    ```

    ## Custom git user on different project folder
    // ~/workstation/google/.gitconfig
    // ~/.google.gitconfig
    ```
    [user]
    email = [email protected]
    @@ -75,7 +75,14 @@ Host z1

    // ~/.gitconfig
    ```
    [includeIf "gitdir:~/google/"]
    path = ~/workstation/google/.gitconfig
    # Default Git Profile
    [user]
    name = Dennis Gonzales
    email = [email protected]
    # Custom Git Profile for Directory Z1
    [includeIf "gitdir:~/Workstation/google/"]
    path = ~/.google.gitconfig
    ```

  19. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,7 @@ ssh-add -L # full key in OpenSSH format
    ```

    [Similar guide 1](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)

    [Similar guide 2](https://aaneloy.github.io/Github-SSH-windows-11/)

    # Setting up SSH with Git
  20. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # Setting up SSH key ([Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/))
    # Setting up SSH key


    ## Generate SSH key

    @@ -40,6 +41,9 @@ ssh-add -l # list by fingerprint
    ssh-add -L # full key in OpenSSH format
    ```

    [Similar guide 1](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent)
    [Similar guide 2](https://aaneloy.github.io/Github-SSH-windows-11/)

    # Setting up SSH with Git

    ### Example config file for managing SSH profiles
  21. dennis-gonzales revised this gist Jun 26, 2023. No changes.
  22. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Setting up SSH key [Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/)
    # Setting up SSH key ([Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/))

    ## Generate SSH key

  23. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Setting up SSH key
    # Setting up SSH key [Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/)

    ## Generate SSH key

    @@ -74,5 +74,3 @@ Host z1
    path = ~/workstation/google/.gitconfig
    ```


    [Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/)
  24. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -40,6 +40,7 @@ ssh-add -l # list by fingerprint
    ssh-add -L # full key in OpenSSH format
    ```

    # Setting up SSH with Git

    ### Example config file for managing SSH profiles
    // ~/.ssh/config
    @@ -59,8 +60,6 @@ Host z1
    ```

    # Setting up SSH with Git

    ## Custom git user on different project folder
    // ~/workstation/google/.gitconfig
    ```
  25. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Setting up SSH key

    ## Generate SSH key

    ```bash
    @@ -57,7 +59,9 @@ Host z1
    ```

    ### Custom git user on different project folder
    # Setting up SSH with Git

    ## Custom git user on different project folder
    // ~/workstation/google/.gitconfig
    ```
    [user]
  26. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -32,6 +32,12 @@ ssh -T [email protected] # default
    ssh -T git@work # org name
    ```

    ### List all keys added to ssh-agent
    ```bash
    ssh-add -l # list by fingerprint
    ssh-add -L # full key in OpenSSH format
    ```


    ### Example config file for managing SSH profiles
    // ~/.ssh/config
  27. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,8 @@

    ### Generate SSH key with custom name
    ```bash
    ssh-keygen -t ed25519 -f ~/.ssh/dennis_ed25519 -C [email protected] #ed25519 encryption
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/dennis_rsa -C [email protected] # rsa encryption
    ssh-keygen -t ed25519 -f ~/.ssh/personal_ed25519 -C [email protected] #ed25519 encryption
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/personal_rsa -C [email protected] # rsa encryption
    ```

    ## Start SSH agent
  28. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    ### Generate SSH key with custom name
    ```bash
    ssh-keygen -t ed25519 -f ~/.ssh/dennis_ed25519 -C [email protected] #ed25519 encryption
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/dennis_ed25519 -C [email protected] # rsa encryption
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/dennis_rsa -C [email protected] # rsa encryption
    ```

    ## Start SSH agent
  29. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,14 @@
    ## Generate SSH key

    ```bash
    ssh-keygen -t ed25519 -C [email protected]
    ssh-keygen -t ed25519 -C [email protected] #ed25519 encryption
    ssh-keygen -t rsa -b 4096 -C [email protected] # rsa encryption
    ```

    ### Generate SSH key with custom name
    ```bash
    ssh-keygen -t ed25519 -f ~/.ssh/dennis_ed25519 -C [email protected]
    ssh-keygen -t ed25519 -f ~/.ssh/dennis_ed25519 -C [email protected] #ed25519 encryption
    ssh-keygen -t rsa -b 4096 -f ~/.ssh/dennis_ed25519 -C [email protected] # rsa encryption
    ```

    ## Start SSH agent
  30. dennis-gonzales revised this gist Jun 26, 2023. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions SSH Configuration with Git.MD
    Original file line number Diff line number Diff line change
    @@ -62,3 +62,6 @@ Host z1
    [includeIf "gitdir:~/google/"]
    path = ~/workstation/google/.gitconfig
    ```


    [Similar guide](https://aaneloy.github.io/Github-SSH-windows-11/)