2023-05-08 08:44:07 +08:00
|
|
|
|
[#]: subject: "How to Install FreeIPA Client on RHEL | Rocky Linux | AlmaLinux"
|
|
|
|
|
[#]: via: "https://www.linuxtechi.com/install-freeipa-client-on-rhel-rockylinux-almalinux/"
|
|
|
|
|
[#]: author: "Pradeep Kumar https://www.linuxtechi.com/author/pradeep/"
|
|
|
|
|
[#]: collector: "lkxed"
|
|
|
|
|
[#]: translator: "geekpi"
|
2023-05-12 18:30:04 +08:00
|
|
|
|
[#]: reviewer: "wxy"
|
|
|
|
|
[#]: publisher: "wxy"
|
|
|
|
|
[#]: url: "https://linux.cn/article-15806-1.html"
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
如何在 RHEL 8 上安装 FreeIPA 客户端
|
2023-05-08 08:44:07 +08:00
|
|
|
|
======
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
![][0]
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
> 在本文中,我们将向你展示如何在 RHEL、Rocky Linux 或 AlmaLinux 上安装和配置 FreeIPA 客户端。
|
|
|
|
|
|
|
|
|
|
为了演示,我们在 RHEL 系统上集成了 [FreeIPA 服务器][6],使用 FreeIPA 进行集中认证。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
FreeIPA 服务器是一个开源的身份管理解决方案,为 Linux 系统提供集中的身份验证、授权和帐户信息。
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
### 先决条件
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
- 已预装 RHEL 9/8 或 Rocky Linux 9/8 或 AlmaLinux 9/8
|
2023-05-08 08:44:07 +08:00
|
|
|
|
- 具有 sudo 权限的普通用户
|
|
|
|
|
- RHEL 系统的有效订阅。
|
|
|
|
|
- 互联网连接
|
|
|
|
|
|
|
|
|
|
事不宜迟,让我们深入了解 FreeIPA 客户端安装和配置步骤,
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
### 1、在 FreeIPA 服务器上创建一个用户
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
登录到 FreeIPA 服务器并创建一个用户以进行集中身份验证,这里我使用以下命令使用创建了一个用户 `opsadm`:
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ sudo kinit admin
|
|
|
|
|
$ sudo ipa user-add opsadm --first=Ops --last=Admin --password
|
|
|
|
|
Password:
|
|
|
|
|
Enter Password again to verify:
|
|
|
|
|
-------------------
|
|
|
|
|
Added user "opsadm"
|
|
|
|
|
-------------------
|
|
|
|
|
User login: opsadm
|
|
|
|
|
First name: Ops
|
|
|
|
|
Last name: Admin
|
|
|
|
|
Full name: Ops Admin
|
|
|
|
|
Display name: Ops Admin
|
|
|
|
|
Initials: OA
|
|
|
|
|
Home directory: /home/opsadm
|
|
|
|
|
GECOS: Ops Admin
|
|
|
|
|
Login shell: /bin/bash
|
2023-05-12 18:30:04 +08:00
|
|
|
|
Principal name: opsadm@LINUXTECHI.LAN
|
|
|
|
|
Principal alias: opsadm@LINUXTECHI.LAN
|
2023-05-08 08:44:07 +08:00
|
|
|
|
User password expiration: 20230502010113Z
|
2023-05-12 18:30:04 +08:00
|
|
|
|
Email address: opsadm@linuxtechi.lan
|
2023-05-08 08:44:07 +08:00
|
|
|
|
UID: 464600004
|
|
|
|
|
GID: 464600004
|
|
|
|
|
Password: True
|
|
|
|
|
Member of groups: ipausers
|
|
|
|
|
Kerberos keys available: True
|
|
|
|
|
$
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
### 2、为 RHEL、Rocky Linux 或 AlmaLinux 添加 DNS 记录
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
下一步是为我们想要与 FreeIPA 服务器集成以集中身份验证的机器添加 DNS 记录。在 FreeIPA 服务器上,运行以下命令:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ sudo ipa dnsrecord-add linuxtechi.lan rhel.linuxtechi.lan --a-rec 192.168.1.2
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
注意:在上述命令中**替换**为你自己的 IP 地址和主机名。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
![][1]
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
现在登录到 RHEL 客户端并在 `/etc/hosts` 文件中添加以下条目:
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
192.168.1.102 ipa.linuxtechi.lan ipa
|
|
|
|
|
192.168.1.2 rhel.linuxtechi.lan rhel
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
保存并退出文件。
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
### 3、在 RHEL、RockyLinux 和 AlmaLinux 上安装和配置 FreeIPA 客户端
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
FreeIPA 客户端及其依赖项在默认软件包仓库(AppStream 和 BaseOS)中可用,因此要安装 FreeIPA 客户端,请运行:
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ sudo dnf install freeipa-client -y
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
![][2]
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
安装完成后,配置 FreeIPA 客户端,运行以下命令:
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ sudo ipa-client-install --hostname=`hostname -f` --mkhomedir --server=ipa.linuxtechi.lan --domain linuxtechi.lan --realm LINUXTECHI.LAN
|
|
|
|
|
```
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
根据你的设置**替换** FreeIPA 服务器的主机名、域名和领域。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
输出:
|
|
|
|
|
|
|
|
|
|
![][3]
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
完美,上面的输出确认 `freeipa-client` 命令已成功执行。要测试 FreeIPA 客户端集成,请从当前用户注销并尝试以我们在 IPA 服务器上创建的 `opsadm` 用户身份登录。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
### 4、测试 FreeIPA 客户端
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
试着在你刚刚配置了 FreeIPA 客户端的 RHEL 系统上使用 `opsadm` 用户通过 SSH 登录。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
```
|
|
|
|
|
$ ssh opsadm@<IPAddress-RHEL>
|
|
|
|
|
```
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
![][4]
|
|
|
|
|
|
|
|
|
|
当我们第一次登录系统时,由于密码过期政策,它会提示你设置新密码。
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
修改密码后,再次尝试登录。这次你应该可以登录了。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
![][5]
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
很好,上面的输出确认我们可以使用 `opsadm` 用户登录。这确认 FreeIPA 客户端安装和配置成功。
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
以上就是这篇文章的全部内容,希望你发现它提供了丰富的信息,请在下面的评论部分中发表你的疑问和反馈。
|
|
|
|
|
|
2023-05-12 18:30:04 +08:00
|
|
|
|
*(题图:MJ/583ee400-3bad-4036-a725-f9d2078d69ab)*
|
|
|
|
|
|
2023-05-08 08:44:07 +08:00
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
via: https://www.linuxtechi.com/install-freeipa-client-on-rhel-rockylinux-almalinux/
|
|
|
|
|
|
|
|
|
|
作者:[Pradeep Kumar][a]
|
|
|
|
|
选题:[lkxed][b]
|
|
|
|
|
译者:[geekpi](https://github.com/geekpi)
|
2023-05-12 18:30:04 +08:00
|
|
|
|
校对:[wxy](https://github.com/wxy)
|
2023-05-08 08:44:07 +08:00
|
|
|
|
|
|
|
|
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
|
|
|
|
|
|
|
|
[a]: https://www.linuxtechi.com/author/pradeep/
|
|
|
|
|
[b]: https://github.com/lkxed/
|
|
|
|
|
[1]: https://www.linuxtechi.com/wp-content/uploads/2023/05/Add-DNS-Record-RHEL-RockyLinux-AlmaLinux-1024x73.png?ezimgfmt=ng:webp/ngcb22
|
|
|
|
|
[2]: https://www.linuxtechi.com/wp-content/uploads/2023/05/Install-FreeIPA-Client-DNF-Command-RHEL.png
|
|
|
|
|
[3]: https://www.linuxtechi.com/wp-content/uploads/2023/05/Configure-freeipa-client-command-rhel-1024x618.png?ezimgfmt=ng:webp/ngcb22
|
|
|
|
|
[4]: https://www.linuxtechi.com/wp-content/uploads/2023/05/First-time-login-opsadm-freeipa-rhel.png?ezimgfmt=ng:webp/ngcb22
|
2023-05-12 18:30:04 +08:00
|
|
|
|
[5]: https://www.linuxtechi.com/wp-content/uploads/2023/05/Login-RHEL-System-FreeIPA-Client-1024x198.png?ezimgfmt=ng:webp/ngcb22
|
|
|
|
|
[6]: https://linux.cn/article-15783-1.html
|
|
|
|
|
[0]: https://img.linux.net.cn/data/attachment/album/202305/12/182652jucsshn48zogzs1h.jpg
|