注册 Ubuntu 客户端
本节包含有关注册运行 Ubuntu 操作系统的客户端的信息。
|
SUSE Multi-Linux Manager 支持使用 Salt 的 Ubuntu 22.04 LTS 和 24.04 LTS 客户端。
Bootstrapping is supported for starting Ubuntu clients and performing initial state runs such as setting repositories and performing profile updates. However, the root user on Ubuntu is disabled by default, so to use bootstrapping, you require an existing user with sudo privileges for Python.
|
Canonical 不为 SUSE Multi-Linux Manager 背书,也不为其提供支持。 |
1. 添加软件通道
将 Ubuntu 客户端注册到您的 SUSE Multi-Linux Manager 服务器之前,您需要添加所需的软件通道,并同步这些通道。
|
In the following section, descriptions often default to the |
此过程所需的产品包括:
| 操作系统版本 | 产品名称 |
|---|---|
Ubuntu 24.04 |
Ubuntu 24.04 |
Ubuntu 22.04 |
Ubuntu 22.04 |
在 SUSE Multi-Linux Manager Web UI 中,导航到。
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 recommendedtoggle is turned on. Click the arrow to see the complete list of related products, and ensure that any extra products you require are checked.单击 添加产品 并等待产品完成同步。
或者,您也可以在命令提示符处添加通道。此过程所需的通道包括:
| 操作系统版本 | 基础通道 |
|---|---|
Ubuntu 24.04 |
ubuntu-2404-amd64-main-amd64 |
Ubuntu 22.04 |
ubuntu-2204-amd64-main-amd64 |
在 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>系统会自动启动同步。如果您要手动同步通道,请使用以下命令:
mgrctl exec -- mgr-sync sync --with-children <channel_name>确保同步已完成,然后再继续操作。
2. 镜像 Ubuntu ESM 软件包
Canonical 为 Ubuntu Pro 用户和客户提供 扩展安全维护 (ESM) 软件包。这些软件包为多个操作系统组件和选定的应用程序提供更长的维护期(10 至 12 年)。
如果您从已注册到 Ubuntu Pro 的系统中提取了所需的 GPG 密钥和您的个人持有者令牌,则这些储存库还可以在 SUSE Multi-Linux Manager 中同步。
2.1. 提取 GPG 密钥和持有者令牌
将 Ubuntu 主机注册到 Ubuntu Pro。您可以在 Ubuntu Pro 仪表板中找到自己的个人注册令牌。为此您需要创建一个 Ubuntu One 帐户。
sudo apt-get install ubuntu-advantage-tools sudo pro attach <个人令牌>
注册后,可以在 /etc/apt/auth.conf.d/90ubuntu-advantage 文件中找到持有者令牌:
machine esm.ubuntu.com/apps/ubuntu/ login bearer password <令牌> # ubuntu-pro-client machine esm.ubuntu.com/infra/ubuntu/ login bearer password <令牌> # ubuntu-pro-client
|
将为每个储存库使用一个专用的持有者令牌。 |
在 SUSE Multi-Linux Manager 中配置以下储存库:
2.2. 配置 Ubuntu ESM 储存库
使用以下 URL 创建储存库:
请将 <token> 替换为您的个人持有者令牌。此外,必须将 arch 和 release 替换为以下值之一:
| 体系结构 | 版本 |
|---|---|
|
|
要让 SUSE Multi-Linux Manager 同步储存库,必须导入相应的 GPG 密钥(ubuntu-advantage-esm-infra-trusty.gpg、ubuntu-advantage-esm-apps.gpg)。在已注册到 Ubuntu Pro 的系统上的 /etc/apt/trusted.gpg.d 中可以找到这些密钥。将这些文件复制到 SUSE Multi-Linux Manager 系统,并如下所示将其导入:
mgradm gpg add /path/to/gpg.key
在已同步的 Ubuntu 父通道下创建相应的子通道。之后,便可以同步储存库了。
|
此处所述的过程可用于规避订阅限制 - 但是,这样会违反服务条款并可能导致法律后果。订阅数量必须始终足以涵盖所用的系统数量。 |
3. 检查同步状态
In the SUSE Multi-Linux Manager Web UI, navigate to and select the
Productstab. This dialog displays a completion bar for each product when they are being synchronized.Alternatively, you can navigate to , then click the channel associated to the repository. Navigate to the
Repositoriestab, then clickSyncand checkSync Status.
要在跟踪日志前列出可用日志,请在容器主机上运行以下命令:
mgrctl exec ls /var/log/rhn/reposync/在 SUSE Multi-Linux Manager 容器主机的命令提示符处,以 root 身份检查通道日志文件的同步:
mgrctl exec -ti -- tail -f /var/log/rhn/reposync/<channel-label>.log每个子通道在同步过程中会生成自身的日志。您需要检查所有基础通道和子通道日志文件,以确保同步完成。
|
Ubuntu 通道可能会非常大。同步所需的时间可能会长达数小时。 |
4. 管理 GPG 密钥
安装软件包之前,客户端会使用 GPG 密钥检查这些软件包的真实性。只有可信软件才能安装在客户端上。
|
信任 GPG 密钥对于客户端的安全非常重要。由管理员来决定需要哪些密钥,可以信任哪些密钥。这是因为如果不信任 GPG 密钥,便无法使用软件通道,是否将通道指派给客户端取决于是否信任密钥。 |
有关 GPG 密钥的详细信息,请参见 GPG 密钥。
5. Root 访问权限
默认会为 Ubuntu 上的 root 用户禁用 SSH 访问权限。
To be able to onboard using a regular user, you need to edit the sudoers file.
|
This issue happens with self-installed versions of Ubuntu. If the default user has been granted administrative privileges during installation time, a password is required to perform privilege escalation using |
5.1. 授予 Root 用户访问权限
-
On the client, edit the
sudoersfile:sudo visudo
Grant
sudoaccess to the user by adding this line at the end of thesudoersfile. Replace<user>with the name of the user that is bootstrapping the client in the Web UI:<user> ALL=NOPASSWD: /usr/bin/python, /usr/bin/python2, /usr/bin/python3, /var/tmp/venv-salt-minion/bin/python
|
This procedure grants root access without requiring a password, which is required for registering the client. When the client is successfully installed it runs with root privileges, so the access is no longer required. We recommend that you remove the line from the |
5.2. 通过 SSH 以安装期间创建的用户身份引导
要通过 SSH 引导 Ubuntu 客户端,您必须将安装期间创建的用户添加到 sudo 组,然后从客户端运行引导脚本。
-
On the client, as root, run from the command line (replace
<username>with the name of the install-created user):sudo usermod -aG sudo <username>
-
Bootstrap the client system from its command line (replace
<SERVER_FQDN>with the fully qualified domain name of the SUSE Multi-Linux Manager Server):sudo su - curl -Sks https://<SERVER_FQDN>/pub/bootstrap/bootstrap-script.sh | /bin/bash
|
Ubuntu can only be bootstrapped using the corresponding Ubuntu bootstrap script run from the client system’s command line after issuing |