Knowledge Base
Search
New article
Authentication is disabled (development mode).
Edit article
Title
Tags
Content
<pre><code class="language-bash">gpg --gen-key # Please select what kind of key you want: # (1) RSA and RSA (default) # Your selection? 1 # What keysize do you want? (2048) 4096 # Please specify how long the key should be valid. # 0 = key does not expire # Key is valid for? (0) 0 gpg --list-secret-keys --keyid-format LONG gpg --list-secret-keys --keyid-format SHORT gpg --list-keys # If there is only one key, this is enough... id=$(gpg --list-keys --keyid-format LONG | awk '/^pub/ { sub(/.*\//, "", $2); print $2 }') gpg --edit-key $id trust quit # For ultimate trust, enter # 5\r # y\r gpg --quick-set-expire "$id" 0 gpg --quick-set-expire "$id" 0 "*" gpg --export --armor "$id" > key.pub gpg --export-secret-key --armor "$id" > key.private gpg --import key.pub gpg --allow-secret-key-import --import key.private gpg --delete-secret-key "Real Name" gpg --delete-key "Real Name" gpg --fingerprint git config --global user.signingkey "$id"</code></pre>
Save
Cancel