2018-12-23 12:29:21 +00:00
|
|
|
# apt-key
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> Debian 和 Ubuntu 上的 APT 软件包管理器的密钥管理工具。
|
2021-04-17 14:26:03 +01:00
|
|
|
> 更多信息: <https://manpages.debian.org/latest/apt/apt-key.8.html>.
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 列出可信密钥:
|
2018-12-23 12:29:21 +00:00
|
|
|
|
|
|
|
`apt-key list`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 向可信密钥库中添加一个密钥:
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2019-01-01 05:39:40 +00:00
|
|
|
`apt-key add {{密钥文件.asc}}`
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 从可信密钥库中移除一个密钥:
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2019-10-18 03:33:27 +01:00
|
|
|
`apt-key del {{密钥 id}}`
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 向可信密钥库中添加一个远程密钥:
|
2018-12-23 12:29:21 +00:00
|
|
|
|
|
|
|
`wget -qO - {{https://host.tld/filename.key}} | apt-key add -`
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 指定密钥 ID, 从密钥服务器中添加一个密钥:
|
2018-12-23 12:29:21 +00:00
|
|
|
|
2019-10-18 03:33:27 +01:00
|
|
|
`apt-key adv --keyserver {{pgp.mit.edu}} --recv {{密钥 id}}`
|