ipa服务的配置

FreeIPA

FreeIPA是一个用于Linux/Unix环境的开源身份管理系统,它提供集中式帐户管理和身份验证,如Microsoft Active Directory或LDAP。FreeIPA集成389目录服务器、MIT Kerberos、Apache HTTP服务器、NTP、DNS、Dogtag(证书系统)和SSSD,使其成为管理标识、策略和执行审计跟踪的单一集成安全解决方案。FreeIPA支持通过Web UI和命令行工具来执行管理任务,其主要功能包括:
身份识别: (机器、用户、虚拟机、组、身份验证凭据)
策略: (配置设置,访问控制信息)
审计跟踪: (事件、日志、分析)

安装前准备

1.设置hostname
安装带有集成DNS的FreeIPA,需确保网络配置文件中的 DNS1=127.0.0.1

[root@localhost ~]# vi /etc/resolv.conf
search server.local
nameserver 127.0.0.1

2.设置hostname

[root@localhost ~]# hostnamectl set-hostname ipa.server.local

3.添加hosts条目

[root@localhost ~]# echo "192.168.130.152 ipa.server.local ipa" >> /etc/hosts

4.安装ipa-server ipa-server-dns bind-dyndb-ldap

[root@localhost ~]# yum install -y ipa-server ipa-server-dns bind-dyndb-ldap
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package bind-dyndb-ldap.x86_64 0:11.1-3.el7 will be installed
--> Processing Dependency: bind >= 32:9.9.4-44 for package: bind-dyndb-ldap-11.1-3.el7.x86_64
---> Package ipa-server.x86_64 0:4.5.0-20.el7.centos will be installed
--> Processing Dependency: python2-ipaserver = 4.5.0-20.el7.centos for package: ipa-server-4.5.0-20.el7.centos.x86_64
--> Processing Dependency: ipa-server-common = 4.5.0-20.el7.centos for package: ipa-server-4.5.0-20.el7.centos.x86_64
--> Processing Dependency: ipa-common = 4.5.0-20.el7.centos for package: ipa-server-4.5.0-20.el7.centos.x86_64
--> Processing Dependency: ipa-client = 4.5.0-20.el7.centos for package: ipa-server-4.5.0-20.el7.centos.x86_64
--> Processing Dependency: krb5-server < 1.15.100 for package: ipa-server-4.5.0-20.el7.centos.x86_64
......
......
......
---> Package antlr-tool.noarch 0:2.7.7-30.el7 will be installed
---> Package args4j.noarch 0:2.0.16-13.el7 will be installed
---> Package joda-convert.noarch 0:1.3-5.el7 will be installed
---> Package jvnet-parent.noarch 0:4-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                       Arch   Version                         Repository
                                                                           Size
================================================================================
Installing:
 bind-dyndb-ldap               x86_64 11.1-3.el7                      dvd 122 k
 ipa-server                    x86_64 4.5.0-20.el7.centos             dvd 476 k
 ipa-server-dns                noarch 4.5.0-20.el7.centos             dvd 147 k
Installing for dependencies:
 389-ds-base                   x86_64 1.3.6.1-16.el7                  dvd 1.7 M
 389-ds-base-libs              x86_64 1.3.6.1-16.el7                  dvd 677 k
 antlr-tool                    noarch 2.7.7-30.el7                    dvd 357 k
 apache-commons-cli            noarch 1.2-13.el7                      dvd  50 k
 apache-commons-codec          noarch 1.8-7.el7                       dvd 223 k
......
......
 xerces-j2                     noarch 2.11.0-17.el7_0                 dvd 1.1 M
 xml-commons-apis              noarch 1.4.01-16.el7                   dvd 227 k
 xml-commons-resolver          noarch 1.2-15.el7                      dvd 108 k
 xpp3                          noarch 1.1.3.8-11.el7                  dvd 336 k
 xsom                          noarch 0-10.20110809svn.el7            dvd 380 k

Transaction Summary
================================================================================
Install  3 Packages (+183 Dependent packages)

Total download size: 67 M
Installed size: 148 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                               12 MB/s |  67 MB  00:05
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libdhash-0.4.3-27.el7.x86_64                               1/186
  Installing : libsss_certmap-1.15.2-50.el7.x86_64                        2/186
  Installing : relaxngDatatype-1.0-11.el7.noarch                          3/186
  Installing : python2-pyasn1-0.1.9-7.el7.noarch                          4/186
......
  Installing : httpd-tools-2.4.6-67.el7.centos.x86_64                    60/186
  Installing : ldapjdk-4.19-1.el7.noarch                                 61/186
  Installing : bind-dyndb-ldap-11.1-3.el7.x86_64                         62/186
Enabling SELinux boolean named_write_master_zones
setsebool:  SELinux is disabled.
  Installing : scannotation-1.0.3-0.7.r12.el7.noarch                     63/186
  Installing : glassfish-fastinfoset-1.2.12-9.el7.noarch                 64/186
  Installing : 1:msv-msv-2013.5.1-7.el7.noarch                           65/186
......
  Installing : mod_session-2.4.6-67.el7.centos.x86_64                    96/186
  Installing : mod_auth_gssapi-1.5.1-2.el7.x86_64                        97/186
  Installing : mod_nss-1.0.14-10.el7.x86_64                              98/186

mod_nss certificate database generated.

  Installing : mod_lookup_identity-1.0.0-1.el7.x86_64                    99/186
  Installing : args4j-2.0.16-13.el7.noarch                              100/186
  Installing : txw2-20110809-8.el7.noarch                               101/186
......
......
......
......
......
......
  Verifying  : tomcat-lib-7.0.76-2.el7.noarch                           184/186
  Verifying  : 1:msv-msv-2013.5.1-7.el7.noarch                          185/186
  Verifying  : codemodel-2.6-9.el7.noarch                               186/186

Installed:
  bind-dyndb-ldap.x86_64 0:11.1-3.el7
  ipa-server.x86_64 0:4.5.0-20.el7.centos
  ipa-server-dns.noarch 0:4.5.0-20.el7.centos

Dependency Installed:
  389-ds-base.x86_64 0:1.3.6.1-16.el7
  389-ds-base-libs.x86_64 0:1.3.6.1-16.el7
  antlr-tool.noarch 0:2.7.7-30.el7
......
......
......
  xml-commons-resolver.noarch 0:1.2-15.el7
  xpp3.noarch 0:1.1.3.8-11.el7
  xsom.noarch 0:0-10.20110809svn.el7

Complete!

5.启动Bind(DNS)服务,并设置自动启动

[root@localhost ~]# systemctl start named
[root@localhost ~]# systemctl enable named
Created symlink from /etc/systemd/system/multi-user.target.wants/named.service to /usr/lib/systemd/system/named.service.

6.开始安装FreeIPA

[root@localhost ~]# 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.

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 the KDC to enable PKINIT

To accept the default shown in brackets, press the Enter key.

WARNING: conflicting time&date synchronization service 'chronyd' will be disabled
in favor of ntpd

Do you want to configure integrated DNS (BIND)? [no]: yes

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
.
Example: master.example.com.


Server host name [ipa.server.local]:			<--回车

Warning: skipping DNS resolution of host ipa.server.local
The domain name has been determined based on the host name.

Please confirm the domain name [server.local]:			<--回车

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

Please provide a realm name [SERVER.LOCAL]:			<--回车
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:				<--输入密码(Directory manager password)
Password (confirm):						<--再次输入密码(Directory manager password)

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

IPA admin password:						<--输入密码(IPA Admin password)
Password (confirm):						<--输入密码(IPA Admin password)

Checking DNS domain server.local., please wait ...
Do you want to configure DNS forwarders? [yes]: yes
Following DNS servers are configured in /etc/resolv.conf: 192.168.130.2, 127.0.0.1
Do you want to configure these servers as DNS forwarders? [yes]: yes
All DNS servers from /etc/resolv.conf were added. You can enter additional addresses now:
Enter an IP address for a DNS forwarder, or press Enter to skip: 8.8.8.8
DNS forwarder 8.8.8.8 added. You may add another.
Enter an IP address for a DNS forwarder, or press Enter to skip:
Checking DNS forwarders, please wait ...
DNS server 192.168.130.2: answer to query '. SOA' is missing DNSSEC signatures (no RRSIG data)
Please fix forwarder configuration to enable DNSSEC support.
(For BIND 9 add directive "dnssec-enable yes;" to "options {}")
WARNING: DNSSEC validation will be disabled
Do you want to search for missing reverse zones? [yes]: yes
Do you want to create reverse zone for IP 192.168.130.152 [yes]:
Please specify the reverse zone name [130.168.192.in-addr.arpa.]:
Using reverse zone(s) 130.168.192.in-addr.arpa.

The IPA Master Server will be configured with:
Hostname:       ipa.server.local
IP address(es): 192.168.130.152
Domain name:    server.local
Realm name:     SERVER.LOCAL

BIND DNS server will be configured to serve IPA domain with:
Forwarders:       192.168.130.2, 127.0.0.1, 8.8.8.8
Forward policy:   only
Reverse zone(s):  130.168.192.in-addr.arpa.

Continue to configure the system with these values? [no]: yes

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring NTP daemon (ntpd)
  [1/4]: stopping ntpd
  [2/4]: writing configuration
  [3/4]: configuring ntpd to start on boot
  [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv). Estimated time: 30 seconds
  [1/45]: creating directory server instance
  [2/45]: enabling ldapi
  [3/45]: configure autobind for root
  [4/45]: stopping directory server
  [5/45]: updating configuration in dse.ldif
  [6/45]: starting directory server
  [7/45]: adding default schema
  [8/45]: enabling memberof plugin
  [9/45]: enabling winsync plugin
  [10/45]: configuring replication version plugin
  [11/45]: enabling IPA enrollment plugin
  [12/45]: configuring uniqueness plugin
  [13/45]: configuring uuid plugin
  [14/45]: configuring modrdn plugin
  [15/45]: configuring DNS plugin
  [16/45]: enabling entryUSN plugin
  [17/45]: configuring lockout plugin
  [18/45]: configuring topology plugin
  [19/45]: creating indices
  [20/45]: enabling referential integrity plugin
  [21/45]: configuring certmap.conf
  [22/45]: configure new location for managed entries
  [23/45]: configure dirsrv ccache
  [24/45]: enabling SASL mapping fallback
  [25/45]: restarting directory server
  [26/45]: adding sasl mappings to the directory
  [27/45]: adding default layout
  [28/45]: adding delegation layout
  [29/45]: creating container for managed entries
  [30/45]: configuring user private groups
  [31/45]: configuring netgroups from hostgroups
  [32/45]: creating default Sudo bind user
  [33/45]: creating default Auto Member layout
  [34/45]: adding range check plugin
  [35/45]: creating default HBAC rule allow_all
  [36/45]: adding entries for topology management
  [37/45]: initializing group membership
  [38/45]: adding master entry
  [39/45]: initializing domain level
  [40/45]: configuring Posix uid/gid generation
  [41/45]: adding replication acis
  [42/45]: activating sidgen plugin
  [43/45]: activating extdom plugin
  [44/45]: tuning directory server
  [45/45]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring Kerberos KDC (krb5kdc)
  [1/10]: adding kerberos container to the directory
  [2/10]: configuring KDC
  [3/10]: initialize kerberos container
  [4/10]: adding default ACIs
  [5/10]: creating a keytab for the directory
  [6/10]: creating a keytab for the machine
  [7/10]: adding the password extension to the directory
  [8/10]: creating anonymous principal
  [9/10]: starting the KDC
  [10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
  [1/2]: starting kadmin
  [2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
  [1/29]: configuring certificate server instance

  [2/29]: exporting Dogtag certificate store pin
  [3/29]: stopping certificate server instance to update CS.cfg
  [4/29]: backing up CS.cfg
  [5/29]: disabling nonces
  [6/29]: set up CRL publishing
  [7/29]: enable PKIX certificate path discovery and validation
  [8/29]: starting certificate server instance
  [9/29]: configure certmonger for renewals
  [10/29]: requesting RA certificate from CA
  [11/29]: setting up signing cert profile
  [12/29]: setting audit signing renewal to 2 years
  [13/29]: restarting certificate server
  [14/29]: publishing the CA certificate
  [15/29]: adding RA agent as a trusted user
  [16/29]: authorizing RA to modify profiles
  [17/29]: authorizing RA to manage lightweight CAs
  [18/29]: Ensure lightweight CAs container exists
  [19/29]: configure certificate renewals
  [20/29]: configure Server-Cert certificate renewal
  [21/29]: Configure HTTP to proxy connections
  [22/29]: restarting certificate server
  [23/29]: updating IPA configuration
  [24/29]: enabling CA instance
  [25/29]: migrating certificate profiles to LDAP
  [26/29]: importing IPA certificate profiles
  [27/29]: adding default CA ACL
  [28/29]: adding 'ipa' CA entry
  [29/29]: configuring certmonger renewal for lightweight CAs
Done configuring certificate server (pki-tomcatd).
Configuring directory server (dirsrv)
  [1/3]: configuring TLS for DS instance
  [2/3]: adding CA certificate entry
  [3/3]: restarting directory server
Done configuring directory server (dirsrv).
Configuring ipa-otpd
  [1/2]: starting ipa-otpd
  [2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Configuring ipa-custodia
  [1/5]: Generating ipa-custodia config file
  [2/5]: Making sure custodia container exists
  [3/5]: Generating ipa-custodia keys
  [4/5]: starting ipa-custodia
  [5/5]: configuring ipa-custodia to start on boot
Done configuring ipa-custodia.
Configuring the web interface (httpd)
  [1/22]: stopping httpd
  [2/22]: setting mod_nss port to 443
  [3/22]: setting mod_nss cipher suite
  [4/22]: setting mod_nss protocol list to TLSv1.0 - TLSv1.2
  [5/22]: setting mod_nss password file
  [6/22]: enabling mod_nss renegotiate
  [7/22]: disabling mod_nss OCSP
  [8/22]: adding URL rewriting rules
  [9/22]: configuring httpd
  [10/22]: setting up httpd keytab
  [11/22]: configuring Gssproxy
  [12/22]: setting up ssl
  [13/22]: configure certmonger for renewals
  [14/22]: importing CA certificates from LDAP
  [15/22]: publish CA cert
  [16/22]: clean up any existing httpd ccaches
  [17/22]: configuring SELinux for httpd
  [18/22]: create KDC proxy config
  [19/22]: enable KDC proxy
  [20/22]: starting httpd
  [21/22]: configuring httpd to start on boot
  [22/22]: enabling oddjobd
Done configuring the web interface (httpd).
Configuring Kerberos KDC (krb5kdc)
  [1/1]: installing X509 Certificate for PKINIT
Done configuring Kerberos KDC (krb5kdc).
Applying LDAP updates
Upgrading IPA:. Estimated time: 1 minute 30 seconds
  [1/9]: stopping directory server
  [2/9]: saving configuration
  [3/9]: disabling listeners
  [4/9]: enabling DS global lock
  [5/9]: starting directory server
  [6/9]: upgrading server
  [7/9]: stopping directory server
  [8/9]: restoring configuration
  [9/9]: starting directory server
Done.
Restarting the KDC
Configuring DNS (named)
  [1/12]: generating rndc key file
  [2/12]: adding DNS container
  [3/12]: setting up our zone
  [4/12]: setting up reverse zone
  [5/12]: setting up our own record
  [6/12]: setting up records for other masters
  [7/12]: adding NS record to the zones
  [8/12]: setting up kerberos principal
  [9/12]: setting up named.conf
  [10/12]: setting up server configuration
  [11/12]: configuring named to start on boot
  [12/12]: changing resolv.conf to point to ourselves
Done configuring DNS (named).
Restarting the web server to pick up resolv.conf changes
Configuring DNS key synchronization service (ipa-dnskeysyncd)
  [1/7]: checking status
  [2/7]: setting up bind-dyndb-ldap working directory
  [3/7]: setting up kerberos principal
  [4/7]: setting up SoftHSM
  [5/7]: adding DNSSEC containers
  [6/7]: creating replica keys
  [7/7]: configuring ipa-dnskeysyncd to start on boot
Done configuring DNS key synchronization service (ipa-dnskeysyncd).
Restarting ipa-dnskeysyncd
Restarting named
Updating DNS system records
Configuring client side components
Using existing certificate '/etc/ipa/ca.crt'.
Client hostname: ipa.server.local
Realm: SERVER.LOCAL
DNS Domain: server.local
IPA Server: ipa.server.local
BaseDN: dc=server,dc=local

Skipping synchronizing time with NTP server.
New SSSD config will be created
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
trying https://ipa.server.local/ipa/json
[try 1]: Forwarding 'schema' to json server 'https://ipa.server.local/ipa/json'
trying https://ipa.server.local/ipa/session/json
[try 1]: Forwarding 'ping' to json server 'https://ipa.server.local/ipa/session/json'
[try 1]: Forwarding 'ca_is_enabled' to json server 'https://ipa.server.local/ipa/session/json'
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
[try 1]: Forwarding 'host_mod' to json server 'https://ipa.server.local/ipa/session/json'
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring server.local as NIS domain.
Client configuration complete.
The ipa-client-install command was successful

==============================================================================
Setup complete

Next steps:
        1. You must make sure these network ports are open:
                TCP Ports:
                  * 80, 443: HTTP/HTTPS
                  * 389, 636: LDAP/LDAPS
                  * 88, 464: kerberos
                  * 53: bind
                UDP Ports:
                  * 88, 464: kerberos
                  * 53: bind
                  * 123: ntp

        2. You can now obtain a kerberos ticket using the command: 'kinit admin'
           This ticket will allow you to use the IPA tools (e.g., ipa user-add)
           and the web user interface.

Be sure to back up the CA certificates stored in /root/cacert.p12
These files are required to create replicas. The password for these
files is the Directory Manager password

7.配置防火墙,开放需要使用到的端口
for SER in ntp http https ldap ldaps kerberos kpasswd; do firewall-cmd --permanent --add-service=$SER; done
firewall-cmd --permanent --add-port=53/udp
firewall-cmd --permanent --add-port=53/tcp
firewall-cmd --reload
这里我直接关闭了SELinux防火墙

8.验证 FreeIPA Server
8.1.安装FreeIPA之后,对Kerberos领域进行身份验证,以确保正确配置管理员。

[root@localhost ~]# kinit admin
Password for [email protected]:				<--这里密码要大于8位

8.2.通过搜索IPA用户验证FreeIPA服务器功能

[root@localhost ~]# ipa user-find admin
--------------
1 user matched
--------------
  User login: admin
  Last name: Administrator
  Home directory: /home/admin
  Login shell: /bin/bash
  Principal alias: [email protected]
  UID: 1477600000
  GID: 1477600000
  Account disabled: False
----------------------------
Number of entries returned 1
----------------------------

9.访问FreeIPA
通过浏览器访问FreeIPA服务器的IP地址192.168.17.20,会自动跳转到FreeIPA服务器的域名,说明DNS解析正常。默认用户名:admin,密码为前面安装过程中设置的密码。
ipa服务的配置_第1张图片

FreeIPA主页面
ipa服务的配置_第2张图片

你可能感兴趣的:(Linux学习)