TranslateProject/translated/tech/20230502.1 ⭐️ How to Install FreeIPA Client on RHEL Rocky Linux AlmaLinux.md

145 lines
5.0 KiB
Markdown
Raw Normal View History

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"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
如何在 RHEL | Rocky Linux | AlmaLinux 上安装 FreeIPA 客户端
======
在本文中,我们将向你展示如何在 RHEL、Rocky Linux 或 AlmaLinux 上安装和配置 FreeIPA 客户端。
为了演示,我们将使用 FreeIPA 客户端将 RHEL 系统与 FreeIPA 服务器集成,以实现集中认证。
FreeIPA 服务器是一个开源的身份管理解决方案,为 Linux 系统提供集中的身份验证、授权和帐户信息。
##### 先决条件
- 预装 RHEL-9/8 或 Rocky Linux9/8 或 AlmaLinux 9/8
- 具有 sudo 权限的普通用户
- RHEL 系统的有效订阅。
- 互联网连接
事不宜迟,让我们深入了解 FreeIPA 客户端安装和配置步骤,
### 1) 在 FreeIPA 服务器上创建一个用户
登录到 FreeIPA 服务器并创建一个用户以进行集中身份验证,这里我使用以下命令使用 opsadm 创建一个用户。
```
$ 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
Principal name: [email protected]
Principal alias: [email protected]
User password expiration: 20230502010113Z
Email address: [email protected]
UID: 464600004
GID: 464600004
Password: True
Member of groups: ipausers
Kerberos keys available: True
$
```
### 2) 为 RHEL、Rocky Linux 或 AlmaLinux 添加 DNS 记录
下一步是为我们想要与 FreeIPA 服务器集成以集中身份验证的机器添加 DNS 记录。在 FreeIPA 服务器上,运行以下命令:
```
$ sudo ipa dnsrecord-add linuxtechi.lan rhel.linuxtechi.lan --a-rec 192.168.1.2
```
注意:在上述命令中替换你自己的 IP 地址和主机名。
![][1]
现在登录到 RHEL 客户端并在 /etc/hosts 文件中添加以下条目:
```
192.168.1.102 ipa.linuxtechi.lan ipa
192.168.1.2 rhel.linuxtechi.lan rhel
```
保存并退出文件。
### 3) 在 RHEL、RockyLinux 和 AlmaLinux 上安装和配置 FreeIPA 客户端
FreeIPA 客户端及其依赖项在默认软件包仓库AppStream 和 BaseOS中可用因此要安装 freeipa 客户端,请运行:
```
$ sudo dnf install freeipa-client -y
```
![][2]
安装完成后配置FreeIPA客户端运行以下命令
```
$ sudo ipa-client-install --hostname=`hostname -f` --mkhomedir --server=ipa.linuxtechi.lan --domain linuxtechi.lan --realm LINUXTECHI.LAN
```
//根据你的设置替换 freeipa 服务器的主机名、域名和领域。
输出:
![][3]
完美,上面的输出确认 freeipa-client 命令已成功执行。要测试 freeipa 客户端集成,请从当前用户注销并尝试以我们在 IPA 服务器上创建的 opsadm 用户身份登录。
### 4) 测试 FreeIPA 客户端
试着在你刚刚配置了 FreeIPA 客户端的 rhel 系统上使用 opsadm 用户 ssh 登录。
$ ssh [email protected]<IPAddress-RHEL>
![][4]
当我们第一次登录系统时,由于密码过期政策,它会提示你设置新密码。
修改密码后,再次尝试登录。这次你应该可以登录了
```
$ ssh [email protected]
```
![][5]
很好,上面的输出确认我们可以使用 opsadm 用户登录。这确认 FreeIPA 客户端安装和配置成功。
以上就是这篇文章的全部内容,希望你发现它提供了丰富的信息,请在下面的评论部分中发表你的疑问和反馈。
--------------------------------------------------------------------------------
via: https://www.linuxtechi.com/install-freeipa-client-on-rhel-rockylinux-almalinux/
作者:[Pradeep Kumar][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [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
[5]: https://www.linuxtechi.com/wp-content/uploads/2023/05/Login-RHEL-System-FreeIPA-Client-1024x198.png?ezimgfmt=ng:webp/ngcb22