如何将 CA 证书从 Windows 10 添加到 Ubuntu 20.04

如何将 CA 证书从 Windows 10 添加到 Ubuntu 20.04

我想就以下问题寻求您的指导:

我在 virtualBox Ubuntu 20.04 上安装 elasticsearch 时遇到了一些问题,这个虚拟环境位于具有受信任的根证书的 Windows 10 上: 在此处输入图片描述

当使用 Mozilla 时,在 virtualbox Ubuntu 上以某种方式请求此证书,显示以下内容: 在此处输入图片描述

单击“查看证书”时: 在此处输入图片描述

我将证书导出为 DER: 在此处输入图片描述

然后在VirtualBox Ubuntu中导入如下:

sudo cp ./CGI-Web-Gateway2.cer /etc/ssl/certs/CGI-Web-Gateway2.pem
sudo update-ca-certificates

安装 elasticsearch 时,我收到 gpg:未找到有效的 OpenPGP 数据:

sudo wget https://artifacts.elastic.co/GPG-KEY-elasticsearch -O mykey
VirtualBox:/etc$ more mykey
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2.0.14 (GNU/Linux)

mQENBFI3HsoBCADXDtbNJnxbPqB1vDNtCsqhe49vFYsZN9IOZsZXgp7aHjh6CJBD
A+bGFOwyhbd7at35jQjWAw1O3cfYsKAmFy+Ar3LHCMkV3oZspJACTIgCrwnkic/9
CUliQe324qvObU2QRtP4Fl0zWcfb/S8UYzWXWIFuJqMvE9MaRY1bwUBvzoqavLGZ
j3SF1SPO+TB5QrHkrQHBsmX+Jda6d4Ylt8/t6CvMwgQNlrlzIO9WT+YN6zS+sqHd
1YK/aY5qhoLNhp9G/HxhcSVCkLq8SStj1ZZ1S9juBPoXV1ZWNbxFNGwOh/NYGldD
2kmBf3YgCqeLzHahsAEpvAm8TBa7Q9W21C8vABEBAAG0RUVsYXN0aWNzZWFyY2gg
KEVsYXN0aWNzZWFyY2ggU2lnbmluZyBLZXkpIDxkZXZfb3BzQGVsYXN0aWNzZWFy
Y2gub3JnPokBOAQTAQIAIgUCUjceygIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgEC
F4AACgkQ0n1mbNiOQrRzjAgAlTUQ1mgo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iBERQ/
qPDlGR=
=92oX
-----END PGP PUBLIC KEY BLOCK-----
sudo apt-key add <<< mykey
VirtualBox:/etc$ sudo apt-key add <<< mykey
gpg: no valid OpenPGP data found.

执行 apt-get install-elasticsearch 时,我得到:

VirtualBox:/etc$ sudo apt-get update && sudo apt-get install elasticsearch
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://security.ubuntu.com/ubuntu focal-security InRelease             
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease            
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease          
Get:5 https://artifacts.elastic.co/packages/7.x/apt stable InRelease [10.4 kB]
Err:5 https://artifacts.elastic.co/packages/7.x/apt stable InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D27D666CD88E42B4
Reading package lists... Done
W: GPG error: https://artifacts.elastic.co/packages/7.x/apt stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D27D666CD88E42B4
E: The repository 'https://artifacts.elastic.co/packages/7.x/apt stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target DEP-11-icons-hidpi (main/dep11/[email protected]) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/elastic-7.x.list:1 and /etc/apt/sources.list.d/elastic-7.x.list:2

在 VirtualBox Ubuntu 上安装 elasticsearch 并避免证书问题缺少哪些步骤?

多谢

相关内容