注册 openEuler 客户端

本节包含有关注册运行 openEuler 操作系统的客户端的信息。

  • openEuler 储存库 URL 可从 SUSE Customer Center 获取。

  • 软件包和元数据由 OpenAtom Foundation 而不是 SUSE 提供。

  • 有关支持的产品,请参见支持表格和版本说明。

如果 openEuler 实例是在 AWS 中创建的,则其在 /etc/machine-id 中的 machine-id ID 始终相同。请务必在创建实例后重新生成 machine-id。有关详细信息,请参见 对注册克隆的客户端时出现的问题进行查错

1. 添加软件通道

将 openEuler 客户端注册到 SUSE Multi-Linux Manager 服务器之前,需要添加并同步所需的软件通道。

目前支持的体系结构有 x86_64aarch64

In the following section, descriptions often default to the x86_64 architecture. Replace it with other architectures if appropriate.

Table 1. openEuler 产品 - Web UI
操作系统版本 产品名称

openEuler 24.03

openEuler 24.03-LTS-SP1(技术预览)

过程:添加软件通道
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到管理  安装向导  产品

  2. Locate the appropriate products for your client operating system and architecture using the search bar, and check the appropriate product. This will automatically check all mandatory channels. Also all recommended channels are checked as long as the include recommended toggle is turned on. Click the arrow to see the complete list of related products, and ensure that any extra products you require are checked.

  3. 单击 添加产品 并等待产品完成同步。

或者,您也可以在命令提示符处添加通道。此过程所需的通道包括:

Table 2. openEuler 通道 - CLI
操作系统版本 基础通道

openEuler 24.03

openeuler2403-sp1-pool-x86_64

过程:通过命令行添加软件通道
  1. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,以 root 身份命令添加相应的通道:

    mgrctl exec -- mgr-sync add channel <channel_label_1>
    mgrctl exec -- mgr-sync add channel <channel_label_2>
    mgrctl exec -- mgr-sync add channel <channel_label_n>
  2. 系统会自动启动同步。如果您要手动同步通道,请使用以下命令:

    mgrctl exec -- mgr-sync sync --with-children <channel_name>
  3. 确保同步已完成,然后再继续操作。

2. 检查同步状态

过程:通过命令行检查同步进度
  1. 要在跟踪日志前列出可用日志,请在容器主机上运行以下命令:

    mgrctl exec ls /var/log/rhn/reposync/
  2. 在 SUSE Multi-Linux Manager 容器主机的命令提示符处,以 root 身份检查通道日志文件的同步:

    mgrctl exec -ti -- tail -f /var/log/rhn/reposync/<channel-label>.log
  3. 每个子通道在同步过程中会生成自身的日志。您需要检查所有基础通道和子通道日志文件,以确保同步完成。

3. 创建激活密钥

需要创建与您的 openEuler 通道关联的激活密钥。

有关激活密钥的详细信息,请参见 激活密钥

4. 在客户端上信任 GPG 密钥

操作系统要么直接信任自己的 GPG 密钥,要么至少将它们与最小系统一起安装,但通过其他 GPG 密钥签名的第三方软件包需要手动处理。客户端可以在不信任 GPG 密钥的情况下成功引导,但除非密钥受信任,否则您将无法安装新的客户端工具软件包或更新软件包。

客户端现在使用为软件通道输入的 GPG 密钥信息来管理受信任密钥。如果将具有 GPG 密钥信息的软件通道指派给客户端,当通道刷新后或从此通道安装第一个软件包后,系统就会信任该密钥。

软件通道页面中的 GPG 密钥 URL 参数可以包含以空格分隔的多个密钥 URL。如果其为文件 URL,则必须在使用软件通道之前在客户端上部署 GPG 密钥文件。

The GPG keys for the Client Tools Channels of Red Hat based clients are deployed on the client into /etc/pki/rpm-gpg/ and can be referenced with file URLs.

对于 SUSE Liberty Linux 客户端的 GPG 密钥,情况也是如此。

仅当为客户端指派了软件通道时,系统才会导入并信任这些密钥。

由于基于 Debian 的系统仅会对元数据签名,因此不需要为各个通道指定确切的密钥。如果用户按 储存库元数据 中的“使用自己的 GPG 密钥”所述配置了自己的 GPG 密钥来对元数据签名,系统会自动部署并信任该密钥。

5. 用户定义的 GPG 密钥

用户可以定义要部署到客户端的自定义 GPG 密钥。

通过提供某些 pillar 数据并在 Salt 文件系统中提供 GPG 密钥文件,系统会自动将它们部署到客户端。

These keys are deployed into /etc/pki/rpm-gpg/ on RPM based operating systems and to /usr/share/keyrings/ on Debian systems:

Define the pillar key [literal`custom_gpgkeys` for the client you want to deploy the key to and list the names of the key file.

cat /srv/pillar/mypillar.sls
custom_gpgkeys:
  - my_first_gpg.key
  - my_second_gpgkey.gpg

Additionally in the Salt filesystem create a directory named gpg and store there the GPG key files with the name specified in the custom_gpgkeys pillar data.

ls -la /srv/salt/gpg/
/srv/salt/gpg/my_first_gpg.key
/srv/salt/gpg/my_second_gpgkey.gpg

The keys are deployed to the client at /etc/pki/rpm-gpg/my_first_gpg.key and /etc/pki/rpm-gpg/my_second_gpgkey.gpg.

The last step is to add the URL to the GPG key URL field of the software channel. Navigate to Software  Manage  Channels and select the channel you want to modify. Add to GPG key URL the value file:///etc/pki/rpm-gpg/my_first_gpg.key.

6. 引导脚本中的 GPG 密钥

过程:在客户端上使用引导脚本信任 GPG 密钥
  1. On the SUSE Multi-Linux Manager Server, at the command prompt, check the contents of the /srv/www/htdocs/pub/ directory. This directory contains all available public keys. Take a note of the key that applies to the channel assigned to the client you are registering.

  2. Open the relevant bootstrap script, locate the ORG_GPG_KEY= parameter and add the required key. For example:

    uyuni-gpg-pubkey-0d20833e.key

    您无需删除任何以前存储的密钥。

信任 GPG 密钥对于客户端的安全非常重要。由管理员来决定需要哪些密钥,可以信任哪些密钥。如果不信任 GPG 密钥,便无法为客户端指派软件通道。

7. 注册客户端

openEuler 客户端的注册方式与所有其他客户端的注册方式相同。有关详细信息,请参见 客户端注册