RedHat搭建IPA-Server

ipa-server是紅帽身份驗證的一個完整解決方案,上游的開源項目是freeIPA,它自己不提供具體功能,而是整合了389-ds、ipa-server-dns、krb5-server等核心軟件包,造成一個以389-ds(ldap)爲數據存儲後端,krb5-server爲驗證前端,ipa-server-dns爲主機識別,apache+tomcat提供的一個web管理界面,統一的命令行管理界面的身份識別系統。前端

存儲的是主機名(域名)、IP地址、用戶名、密碼等,以讀爲主,所以很是適合ldap的特性。web

驗證服務: Kerberos KDC
存儲服務: Red Hat Directory Server
證書系統: Red Hat Certificate System
域名解析服務: DNS
安全管理服務: SSSD
時間同步服務: NTPapache

Servers     Servers manage all of the services used by domain members.後端

Replicas    Replica are copies of servers. Once a replica is installed, it is functionally identical to a server.tomcat

Clients      Clients, which belong to the Kerberos domains, receive certificates and tickets issued by the servers, and use other centralized services for authentication and authorization.安全

IPA Server和Replicadom

 

IPA Clienttcp

 

相關服務端口ide

Service Ports Type
HTTP/HTTPS    80, 443    TCP
LDAP/LDAPS    389, 636   TCP
Kerberos      88, 464    TCP and UDP
DNS           53         TCP and UDP
NTP           123        UDP

環境概覽測試

角色              主機名                         IP地址                       網關                    DNS
IPA-Server    ipa.example.com        192.168.136.251/24    192.168.136.2    192.168.136.2
IPA-Replica   replica.example.com   192.268.136.252/24    192.168.136.2    192.168.136.251  192.168.136.2
IPA-Client     client1.example.com   192.168.136.100/24    192.168.136.2    192.168.136.251  192.168.136.252  192.168.136.2

  • IPA-Server

設置機器名

# hostnamectl set-hostname ipa.example.com

開放防火牆端口

# firewall-cmd --permanent --add-port={80/tcp,443/tcp,389/tcp,636/tcp,88/tcp,464/tcp,53/tcp,88/udp,464/udp,53/udp,123/udp}
# firewall-cmd --reload

安裝軟件包

# yum install ipa-server ipa-server-dns

ipa-server-install參數

--hostname=host name
-r realm_name
-n domain_name
--subject=subject_DN
-a ipa_admin_password
-p directory_manager_password
-P kerberos_master_password
--idmax=number
--idstart=number
--ip-address
--setup-dns
--forwarder=forwarder
--no-forwarders
--no-reverse

安裝IPA Server

# ipa-server-install --hostname ipa.example.com --ip-address=192.168.136.251 \
   --setup-dns --forwarder=192.168.136.2 \
   -r  EXAMPLE.COM -n  EXAMPLE.COM \
   -p  DM_password -a  admin_password
注:
DM_password 是kerberos的管理員密碼
admin_password 是389-ds的管理員密碼
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)
  * Configure DNS (bind)

 

卸載IPA Server

# ipa-server-install --uninstall
  • IPA-Replica

設置機器名

# hostnamectl set-hostname replica.example.com

開放防火牆端口

# firewall-cmd --permanent --add-port={80/tcp,443/tcp,389/tcp,636/tcp,88/tcp,464/tcp,53/tcp,88/udp,464/udp,53/udp,123/udp}
# firewall-cmd --reload

安裝軟件包

# yum install ipa-server ipa-server-dns

生成gpg文件

在IPA Server上運行
# ipa-replica-prepare replica.example.com --ip-address 192.168.136.252
# scp /var/lib/ipa/replica-info-replica.example.com.gpg root@replica:/var/lib/ipa/

安裝IPA Replica

# ipa-replica-install /var/lib/ipa/replica-info-replica.example.com.gpg \
   --setup-dns --forwarder 192.168.136.2 \
   -p DM_password -w admin_password

測試IPA Replica

# ipa user-add test_user --first=Test --last=User
# ipa user-show test_user

卸載IPA Replica

# ipa-replica-manage del replica.example.com
# ipa-server-install --uninstall
  • IPA-Client

設置機器名

# hostnamectl set-hostname client1.example.com

開放防火牆端口

# firewall-cmd --permanent --add-port={80/tcp,443/tcp,389/tcp,636/tcp,88/tcp,464/tcp,53/tcp,88/udp,464/udp,53/udp,123/udp}
# firewall-cmd --reload

安裝軟件包

yum install ipa-client

安裝IPA Client

# ipa-client-install --enable-dns-updates --domain EXAMPLE.COM --mkhomedir --no-ntp -p admin

  • IPA 管理

服務管理

# ipactl start|stop|restart|status   (IPA服務啓動,中止,重啓,狀態)

用戶管理

添加用戶
# ipa user-add jsmith
修改用戶
# ipa user-mod jsmith --title="Editor III"
刪除用戶
# ipa user-del jsmith查找用戶# ipa user-find smith
相關文章
相關標籤/搜索