如何在 Rocky Linux 8 上安装 FreeIPA

在本教程中,我们将向您展示如何在 Rocky Linux 8 上安装 FreeIPA。对于那些不知道的人,FreeIPA 代表 Free Identity、Policy、Audit,它是一个基于 LDAP 的开源身份管理解决方案目录和 Kerberos 以及 DNS 服务器、证书颁发机构等可选组件。 FreeIPA 建立在众所周知的开源组件和标准协议之上,非常注重易于管理以及安装和配置任务的自动化。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单,假设您在 root 帐户下运行,如果不是,您可能需要添加 ‘sudo‘ 到命令以获取 root 权限。 我将向您展示在 Rocky Linux 上逐步安装 FreeIPA。 8.

先决条件

  • 运行以下操作系统之一的服务器:Rocky Linux 8。
  • 建议您使用全新的操作系统安装来防止任何潜在问题。
  • 对服务器的 SSH 访问(或者如果您在桌面上,则只需打开终端)。
  • 一个 non-root sudo user或访问 root user. 我们建议充当 non-root sudo user,但是,如果您在充当 root 时不小心,可能会损害您的系统。

在 Rocky Linux 8 上安装 FreeIPA

步骤 1. 第一步是将您的系统更新到最新版本的软件包列表。 为此,请运行以下命令:

sudo dnf check-update sudo dnf update sudo dnf install epel-release

步骤 2. 设置主机名。

FreeIPA 需要一个完全限定的域名。 如果您在安装过程中没有更改主机名,请使用 hostnamectl 命令:

sudo hostnamectl set-hostname freeipa.idroot.us

步骤 3. 在 Rocky Linux 8 上安装 FreeIPA。

默认情况下,FreeIPA 在 Rocky Linux 8 基础存储库中不可用。 首先,启用身份管理 appstream repo:

sudo dnf install @idm:DL1

在您的服务器系统上启用 IDM(身份管理应用程序流)模块后,现在我们使用以下命令安装 FreeIPA 所需的所有软件包:

sudo dnf install ipa-server

安装了 FreeIPA 包后,现在我们设置 FreeIPA,运行命令ipa-server-install. 这是一个交互式安装,您需要回答一些必要的信息:

sudo ipa-server-install

输出:

The log file for this installation can be found in /var/log/ipaserver-install.log ============================================================================== This program will set up the IPA Server. Version 4.9.4  This includes:   * Configure a stand-alone CA (dogtag) for certificate management   * Configure the NTP client (chronyd)   * Create and configure an instance of Directory Server   * Create and configure a Kerberos Key Distribution Center (KDC)   * Configure Apache (httpd)   * Configure the KDC to enable PKINIT  To accept the default shown in brackets, press the Enter key.  Do you want to configure integrated DNS (BIND)? [no]: no  Enter the fully qualified domain name of the computer on which you're setting up server software. Using the form <hostname>.<domainname> Example: master.example.com.  Server host name [freeipa.idroot.us]: freeipa.idroot.us  The domain name has been determined based on the host name.  Please confirm the domain name [idroot.us]: freeipa.idroot.us  The kerberos protocol requires a Realm name to be defined. This is typically the domain name converted to uppercase.  Please provide a realm name [freeipa.idroot.us]: freeipa.idroot.us Certain directory server operations require an administrative user. This user is referred to as the Directory Manager and has full access to the Directory for system management tasks and will be added to the instance of directory server created for IPA. The password must be at least 8 characters long.  Directory Manager password: Password (confirm):

步骤 4. 配置防火墙规则。

如果您的服务器上安装并配置了任何防火墙,那么您将需要通过 firewalld 允许端口。 您可以使用以下命令允许它们:

sudo firewall-cmd --add-service={http,https,dns,ntp,freeipa-ldap,freeipa-ldaps} --permanent sudo firewall-cmd --reload

您可以通过列出当前的防火墙设置来验证:

sudo firewall-cmd --permanent --list-all

步骤 5. 访问 FreeIPA Web 界面。

成功安装后,您可以使用该地址访问 FreeIPA https://freeipa.idroot.us. 忽略私有 SSL 警告并进入 FreeIPA 服务器登录页面。 用户名是 admin 而密码就是你在安装过程中设置的密码。

成功登录后,您将看到 Identity Dashboard 界面:

在 Rocky Linux 8 上安装 FreeIPA

恭喜! 您已成功安装 FreeIPA。 感谢您使用本教程在 Rocky Linux 8 系统上安装 FreeIPA。 如需更多帮助或有用信息,我们建议您查看 FreeIPA 官方网站.