SciTech-BigDataAIML-Github-Generating a new GPG key
Generating a new GPG key
Generating a new GPG key
If you don't have an existing GPG key, you can generate a new GPG key to use for signing commits and tags.
TOC(Table of Contents)
In this article
- Generating a GPG key
- Further reading
- Supported GPG key algorithms
GitHub supported several GPG key algorithms
If you try to add a key generated with an unsupported algorithm, you may encounter an error.
- RSA
- ElGamal
- DSA
- ECDH
- ECDSA
- EdDSA
Generating a GPG key
Note: Before generating a new GPG key, make sure you've verified your email address. If you haven't verified your email address, you won't be able to sign commits and tags with GPG. For more information, see "Verifying your email address."
Download and install the GPG command line tools command line tools for your operating system. We generally recommend installing the latest version for your operating system.
Open Terminal.
Generate a GPG key pair. Since there are multiple versions of GPG, you may need to consult the relevant man page to find the appropriate key generation command.
- If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair.
Shell :gpg --full-generate-key - If you are not on version 2.1.17 or greater, the
gpg --full-generate-keycommand doesn't work.
Paste the text below and skip to step 6.
Shell:gpg --default-new-key-algo rsa4096 --gen-key
- If you are on version 2.1.17 or greater, paste the text below to generate a GPG key pair.
At the prompt, specify
the kind of keyyou want, or pressEnterto accept thedefault.At the prompt, specify
the key sizeyou want, or pressEnterto accept thedefault.Enter the
length of timethe key should be valid. PressEnterto specify thedefaultselection, indicating that thekey doesn't expire. Unless you require an expiration date, we recommend accepting this default.Verify that your selections are correct.
Enter your user ID information.
Note: When asked to enter your email address, ensure that you enter the verified email address for your GitHub account. To keep your email address private, use your GitHub-provided no-reply email address. For more information, see "Verifying your email address" and "Setting your commit email address."
Type a secure passphrase.
Use the
gpg --list-secret-keys --keyid-format=longcommand,
to listthe long form of the GPG keys,
for which you haveboth a public and private key.
A private keyis required forsigning commits or tags.
Shell:gpg --list-secret-keys --keyid-format=longNote: Some GPG installations on Linux may require you to use gpg2 --list-keys --keyid-format LONG to view a list of your existing keys instead. In this case you will also need to configure Git to use gpg2 by running git config --global gpg.program gpg2.
From the list of GPG keys, copy the long form of the GPG key ID you'd like to use. In this example, the GPG key ID is 3AA5C34371567BD2:
Shell:$ gpg --list-secret-keys --keyid-format=long
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot <hubot@example.com>
ssb 4096R/4BB6D45482678BE3 2016-03-10
Paste the text below, substituting in the
GPG key IDyou'd like to use. In this example, the GPG key ID is3AA5C34371567BD2:gpg --armor --export 3AA5C34371567BD2
# Prints the GPG key ID, in ASCII armor format
Copy your
GPG key, beginning with-----BEGIN PGP PUBLIC KEY BLOCK-----and ending with-----END PGP PUBLIC KEY BLOCK-----.
Sample Interaction with gpg:
**$ gpg --full-generate-key**
gpg (GnuPG) 2.2.40; Copyright (C) 2022 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
(14) Existing key from card
Your selection?
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (3072) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: Abael He
Email address: abaelhe@icloud.com
Comment:
You selected this USER-ID: "Abael He <abaelhe@icloud.com>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: directory '/root/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/5E1A6E1D77B81072AD2AAC4AD2604453D5F3027D.rev'
**public and secret key created and signed**.
pub rsa4096 2024-09-27 [SC]
5E1A6E1D77B81072AD2AAC4AD2604453D5F3027D
uid Abael He <abaelhe@icloud.com>
sub rsa4096 2024-09-27 [E]
**$ gpg --list-secret-keys --keyid-format=long**
gpg: checking the trustdb
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
/root/.gnupg/pubring.kbx
------------------------
sec rsa4096/D2604453D5F3027D 2024-09-27 [SC]
5E1A6E1D77B81072AD2AAC4AD2604453D5F3027D
uid [ultimate] Abael He <abaelhe@icloud.com>
ssb rsa4096/2339955A5BFA7243 2024-09-27 [E]
**$ gpg --armor --export D2604453D5F3027D**
-----BEGIN PGP PUBLIC KEY BLOCK-----
...
-----END PGP PUBLIC KEY BLOCK-----
**$ gpg --armor --export D2604453D5F3027D > ~/gpg_rsa4096.pubkey**
SciTech-BigDataAIML-Github-Generating a new GPG key的更多相关文章
- github with msysgit:配置SSH Key
Step 1: Check for SSH keys First, we need to check for existing ssh keys on your computer. Open up G ...
- DIY的RPM包怎么签名呢 How to sign your custom RPM package with GPG key
https://gist.github.com/fernandoaleman/1376720 How to sign your custom RPM package with GPG key 这是文 ...
- Generating a new SSH key
Open Git Bash. Paste the text below, substituting in your GitHub email address. $ ssh-keygen -t rsa ...
- 多个github帐号的SSH key切换
写在前面的话 github账号,工作有一个,自己有一个.但是默认下使用ssh key在git push时只有默认账号能免输入账号和密码. 如果想让另一个账号在代码push时免账号和密码,请看这篇文章h ...
- Centos GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEYRetrieving key fro ...
- GPG key retrieval failed
Total size: 340 k Installed size: 1.2 M Is this ok [y/N]: y Downloading Packages: warning: rpmts_Hdr ...
- GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-
今天更新为163的源后,yum的时候报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gp ...
- yum -y update 报错:GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
用的是centos6.5的镜像,yum源太老了,修改了之后想更新一下: yum -y update 执行报错: warning: rpmts_HdrFromFdno: Header V3 RSA/SH ...
- 多github帐号的SSH key切换
我有两个github帐号,一个是个人所用,一个是为公司项目所用.如果是单用户(single-user),很方便,默认拿id_rsa与你的github服务器的公钥对比:如果是多用户(multi-user ...
- rpm的gpg key
1 gpg 这是一种公钥.私钥机制. 2 rpm包的格式 rpm包由四部分构成,lead.signature.header和archive构成. 这里的签名(signature)是加密了的,也就是说, ...
随机推荐
- Axure RP中后台管理系统通用原型模板元件库
Axure RP中后台管理系统通用原型方案 v2是一套通用型的中后台信息系统原型方案,可以快速扩展并输出标准美观的中后台产品原型,极大的提升输出效率和节省协作成本.方案中提供了几十套不同风格和结构的系 ...
- tcpdump工具
监视指定的网络接口/网卡 tcpdump -i eth100 通过网卡eth100监视主机的数据包 tcpdump -i eth100 host 190.160.35.11 截获本地发送到目标主机19 ...
- MySQL中create_time 和 update_time实现自动更新时间
也是最近在捣鼓前后端分离项目, 在写后端接口的时候便设计到数据库表建设, 这里规范显得很重要. 通常的建表规范, 必备三字段:id,create_time,update_time. id 必为主键,类 ...
- 记一次docker buildx build 推送到本地私有仓库出现 connection refused 的问题
想在本地编译多个架构的基础镜像,这样后续有其他业务使用的时候,不必从头开始编译. 使用传统的 docker build -t ImageName:tag 方式,只能编译和主机相同架构的镜像. 而doc ...
- RPC实战与核心原理之安全体系
安全体系:如何建立可靠的安全体系? 回顾 异步化".调用方利用异步化机制实现并行调用多个服务,以缩短整个调用时间:而服务提供方则可以利用异步化把业务逻辑放到自定义线程池里面去执行,以提升单机 ...
- Hystrix 服务的隔离策略对比,信号量与线程池隔离的差异
支持的隔离策略 Hystrix支持的 hytrix支持线程池隔离和信号量隔离 信号量的隔离: it executes on the calling thread and concurrent requ ...
- 利用DeepSeek与Python自动生成测试用例!
在当今快节奏的软件开发领域,自动化测试已然成为保障软件质量的中流砥柱.传统手动编写测试用例的方式,非但耗时费力,还极易遗漏关键场景. 所幸,AI 技术的飞速发展为我们带来了全新的解决方案.今天,就让我 ...
- consul在netcore中发现服务和运行状况检查
在这篇文章中,我们将快速了解什么是服务发现,使用consul实现一个基本的服务基础设施:使用asp.net核心mvc框架,并使用dns client.net实现基于dns的客户端服务发现. Servi ...
- 第8讲、Multi-Head Attention 的核心机制与实现细节
为什么要有 Multi-Head Attention? 单个 Attention 机制虽然可以捕捉句子中不同词之间的关系,但它只能关注一种角度或模式. Multi-Head 的作用是: 多个头 = 多 ...
- C++学习思维导图
C++思维导图 整个的思维导图大概的架构如下,Xmind.SVG.PDF格式的下载链接都在下面了,如有需要可自取 Xmind文件分享:https://cnblogs-img.oss-cn-hangzh ...