Skip to content

Instantly share code, notes, and snippets.

@chopeen
Forked from webframp/keybase.md
Last active March 7, 2020 23:09
Show Gist options
  • Save chopeen/890bf2667dba516d70efc0c8cc7a93e6 to your computer and use it in GitHub Desktop.
Save chopeen/890bf2667dba516d70efc0c8cc7a93e6 to your computer and use it in GitHub Desktop.

Revisions

  1. chopeen renamed this gist Mar 7, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. chopeen revised this gist Mar 7, 2020. 1 changed file with 16 additions and 2 deletions.
    18 changes: 16 additions & 2 deletions keybase.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # Local setup

    First get the public key
    ```
    keybase pgp export | gpg2 --import
    @@ -47,12 +49,24 @@ $ git config --global user.signingkey C9D8E1A1
    $ git config --global commit.gpgsign true
    ```

    # GitHub setup

    Now add it to your Github profile:
    ```
    gpg2 --armor --export C9D8E1A1 | xclip
    gpg2 --armor --export C9D8E1A1
    ```
    Add it to your GitHub profile under *Settings/SSH and GPG keys.*
    Replace `xclip` with `clip` or `pbcopy` for your current platform.

    # GPG version for the Git client

    If you see `error: gpg failed to sign the data`, the Git client may be trying to call wrong
    version of the GPG tool.

    ```
    git config --global gpg.program gpg2
    ```

    # Misc

    Use gpg agent if you don't want to enter the password every time.

  3. chopeen revised this gist Mar 7, 2020. 1 changed file with 6 additions and 10 deletions.
    16 changes: 6 additions & 10 deletions keybase.md
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,16 @@
    Probably one of the easiest things you'll ever do with `gpg`

    Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your `PATH`

    First get the public key
    ```
    keybase pgp export | gpg --import
    keybase pgp export | gpg2 --import
    ```

    Next get the private key
    ```
    keybase pgp export --secret | gpg --allow-secret-key --import
    keybase pgp export --secret | gpg2 --allow-secret-key --import
    ```

    Verify progress:
    ```
    gpg --list-secret-keys
    gpg2 --list-secret-keys
    ```

    Looks for something like
    @@ -23,12 +19,12 @@ sec 4096R/C9D8E1A1 2017-02-16 [expires: 2033-02-12]
    uid Sean Escriva <[email protected]>
    ssb 4096R/CC67212E 2017-02-16
    ```
    The email address should match your Github email.
    The email address should match your GitHub email.

    The `C9D8E1A1` part is what you need next. By default this key is untrusted, so we'll fix that.
    To edit trust:
    ```
    $ gpg --edit-key C9D8E1A1
    $ gpg2 --edit-key C9D8E1A1
    gpg> trust
    Please decide how far you trust this user to correctly verify other users' keys
    (by looking at passports, checking fingerprints from different sources, etc.)
    @@ -53,7 +49,7 @@ $ git config --global commit.gpgsign true

    Now add it to your Github profile:
    ```
    gpg --armor --export C9D8E1A1 | xclip
    gpg2 --armor --export C9D8E1A1 | xclip
    ```
    Add it to your GitHub profile under *Settings/SSH and GPG keys.*
    Replace `xclip` with `clip` or `pbcopy` for your current platform.
  4. @webframp webframp created this gist Jul 25, 2017.
    63 changes: 63 additions & 0 deletions keybase.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,63 @@
    Probably one of the easiest things you'll ever do with `gpg`

    Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your `PATH`

    First get the public key
    ```
    keybase pgp export | gpg --import
    ```

    Next get the private key
    ```
    keybase pgp export --secret | gpg --allow-secret-key --import
    ```

    Verify progress:
    ```
    gpg --list-secret-keys
    ```

    Looks for something like
    ```
    sec 4096R/C9D8E1A1 2017-02-16 [expires: 2033-02-12]
    uid Sean Escriva <[email protected]>
    ssb 4096R/CC67212E 2017-02-16
    ```
    The email address should match your Github email.

    The `C9D8E1A1` part is what you need next. By default this key is untrusted, so we'll fix that.
    To edit trust:
    ```
    $ gpg --edit-key C9D8E1A1
    gpg> trust
    Please decide how far you trust this user to correctly verify other users' keys
    (by looking at passports, checking fingerprints from different sources, etc.)
    1 = I don't know or won't say
    2 = I do NOT trust
    3 = I trust marginally
    4 = I trust fully
    5 = I trust ultimately
    m = back to the main menu
    Your decision? 5
    Do you really want to set this key to ultimate trust? (y/N) y
    ```

    There are many levels of trust so choose what you're comfortable with.

    ```
    $ git config --global user.signingkey C9D8E1A1
    $ git config --global commit.gpgsign true
    ```

    Now add it to your Github profile:
    ```
    gpg --armor --export C9D8E1A1 | xclip
    ```
    Add it to your GitHub profile under *Settings/SSH and GPG keys.*
    Replace `xclip` with `clip` or `pbcopy` for your current platform.

    Use gpg agent if you don't want to enter the password every time.

    View signed commits with : `git log --show-signature -1`