• CentOS安装配置freeIPA


    FreeIPA是Linux开源安全解决方案,提供用户账户管理和集中身份验证。

    FreeIPA在CentOS 7、Fedora和Ubuntu14.04 /16.04上能够非常直接地将计算机添加到您的IPA域中。其他操作系统可以使用SSSD或LDAP对FreeIPA进行身份验证。

    freeIPA的部署:

    1、设置主机名:

    hostnamectl set-hostname ipaserver.changchunhua.cloud

    2、升级软件和系统内核:

    yum update -y

    3、设置防火墙:

    systemctl stop firewalld && systemctl disable firewalld

    4、配置hosts文件

    1. vim /etc/hosts
    2. 192.168.17.120 ipaserver.changchunhua.cloud ipaserver

    5、配置随机数生成器:

    1. yum install -y rng-tools
    2. systemctl start rngd
    3. systemctl enable rngd
    4. systemctl status rngd

    6、安装Bind软件并启动:

    1. yum -y install bind bind-utils bind-dyndb-ldap
    2. systemctl start named
    3. systemctl enable named
    4. systemctl status named
    5. vim /etc/resolv.conf
    6. nameserver 127.0.0.1

    7、安装ipa-server软件包:

    yum -y install ipa-server ipa-server-dns

    8、配置ipa-server:

    1. [root@ipaserver ~]# ipa-server-install --allow-zone-overlap
    2. The log file for this installation can be found in /var/log/ipaserver-install.log
    3. ==============================================================================
    4. This program will set up the IPA Server.
    5. This includes:
    6. * Configure a stand-alone CA (dogtag) for certificate management
    7. * Configure the Network Time Daemon (ntpd)
    8. * Create and configure an instance of Directory Server
    9. * Create and configure a Kerberos Key Distribution Center (KDC)
    10. * Configure Apache (httpd)
    11. * Configure the KDC to enable PKINIT
    12. To accept the default shown in brackets, press the Enter key.
    13. Do you want to configure integrated DNS (BIND)? [no]: yes
    14. Enter the fully qualified domain name of the computer
    15. on which you're setting up server software. Using the form
    16. .
    17. Example: master.example.com.
    18. Server host name [ipaserver.changchunhua.cloud]:
    19. Warning: skipping DNS resolution of host ipaserver.changchunhua.cloud
    20. The domain name has been determined based on the host name.
    21. Please confirm the domain name [changchunhua.cloud]:
    22. The kerberos protocol requires a Realm name to be defined.
    23. This is typically the domain name converted to uppercase.
    24. Please provide a realm name [CHANGCHUNHUA.CLOUD]:
    25. Certain directory server operations require an administrative user.
    26. This user is referred to as the Directory Manager and has full access
    27. to the Directory for system management tasks and will be added to the
    28. instance of directory server created for IPA.
    29. The password must be at least 8 characters long.
    30. Directory Manager password:
    31. Password (confirm):
    32. The IPA server requires an administrative user, named 'admin'.
    33. This user is a regular system account used for IPA server administration.
    34. IPA admin password:
    35. Password (confirm):
    36. Checking DNS domain changchunhua.cloud., please wait ...
    37. Do you want to configure DNS forwarders? [yes]:
    38. Following DNS servers are configured in /etc/resolv.conf: 127.0.0.1, 8.8.8.8
    39. Do you want to configure these servers as DNS forwarders? [yes]:
    40. All DNS servers from /etc/resolv.conf were added. You can enter additional addresses now:
    41. Enter an IP address for a DNS forwarder, or press Enter to skip:
    42. Checking DNS forwarders, please wait ...
    43. Do you want to search for missing reverse zones? [yes]:
    44. Do you want to create reverse zone for IP 192.168.17.140 [yes]:
    45. Please specify the reverse zone name [17.168.192.in-addr.arpa.]:
    46. Using reverse zone(s) 17.168.192.in-addr.arpa.
    47. The IPA Master Server will be configured with:
    48. Hostname: ipaserver.changchunhua.cloud
    49. IP address(es): 192.168.17.140
    50. Domain name: changchunhua.cloud
    51. Realm name: CHANGCHUNHUA.CLOUD
    52. BIND DNS server will be configured to serve IPA domain with:
    53. Forwarders: 127.0.0.1, 8.8.8.8
    54. Forward policy: only
    55. Reverse zone(s): 17.168.192.in-addr.arpa.
    56. Continue to configure the system with these values? [no]: yes
    57. The following operations may take some minutes to complete.
    58. Please wait until the prompt is returned.
    59. Configuring NTP daemon (ntpd)
    60. [1/4]: stopping ntpd
    61. [2/4]: writing configuration
    62. [3/4]: configuring ntpd to start on boot
    63. [4/4]: starting ntpd
    64. Done configuring NTP daemon (ntpd).
    65. Configuring directory server (dirsrv). Estimated time: 30 seconds
    66. [1/45]: creating directory server instance
    67. [2/45]: enabling ldapi
    68. [3/45]: configure autobind for root
    69. [4/45]: stopping directory server
    70. [5/45]: updating configuration in dse.ldif
    71. [6/45]: starting directory server
    72. [7/45]: adding default schema
    73. [8/45]: enabling memberof plugin
    74. [9/45]: enabling winsync plugin
    75. [10/45]: configure password logging
    76. [11/45]: configuring replication version plugin
    77. [12/45]: enabling IPA enrollment plugin
    78. [13/45]: configuring uniqueness plugin
    79. [14/45]: configuring uuid plugin
    80. [15/45]: configuring modrdn plugin
    81. [16/45]: configuring DNS plugin
    82. [17/45]: enabling entryUSN plugin
    83. [18/45]: configuring lockout plugin
    84. [19/45]: configuring topology plugin
    85. [20/45]: creating indices
    86. [21/45]: enabling referential integrity plugin
    87. [22/45]: configuring certmap.conf
    88. [23/45]: configure new location for managed entries
    89. [24/45]: configure dirsrv ccache
    90. [25/45]: enabling SASL mapping fallback
    91. [26/45]: restarting directory server
    92. [27/45]: adding sasl mappings to the directory
    93. [28/45]: adding default layout
    94. [29/45]: adding delegation layout
    95. [30/45]: creating container for managed entries
    96. [31/45]: configuring user private groups
    97. [32/45]: configuring netgroups from hostgroups
    98. [33/45]: creating default Sudo bind user
    99. [34/45]: creating default Auto Member layout
    100. [35/45]: adding range check plugin
    101. [36/45]: creating default HBAC rule allow_all
    102. [37/45]: adding entries for topology management
    103. [38/45]: initializing group membership
    104. [39/45]: adding master entry
    105. [40/45]: initializing domain level
    106. [41/45]: configuring Posix uid/gid generation
    107. [42/45]: adding replication acis
    108. [43/45]: activating sidgen plugin
    109. [44/45]: activating extdom plugin
    110. [45/45]: configuring directory to start on boot
    111. Done configuring directory server (dirsrv).
    112. Configuring Kerberos KDC (krb5kdc)
    113. [1/10]: adding kerberos container to the directory
    114. [2/10]: configuring KDC
    115. [3/10]: initialize kerberos container
    116. [4/10]: adding default ACIs
    117. [5/10]: creating a keytab for the directory
    118. [6/10]: creating a keytab for the machine
    119. [7/10]: adding the password extension to the directory
    120. [8/10]: creating anonymous principal
    121. [9/10]: starting the KDC
    122. [10/10]: configuring KDC to start on boot
    123. Done configuring Kerberos KDC (krb5kdc).
    124. Configuring kadmin
    125. [1/2]: starting kadmin
    126. [2/2]: configuring kadmin to start on boot
    127. Done configuring kadmin.
    128. Configuring ipa-custodia
    129. [1/5]: Making sure custodia container exists
    130. [2/5]: Generating ipa-custodia config file
    131. [3/5]: Generating ipa-custodia keys
    132. [4/5]: starting ipa-custodia
    133. [5/5]: configuring ipa-custodia to start on boot
    134. Done configuring ipa-custodia.
    135. Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
    136. [1/30]: configuring certificate server instance
    137. [2/30]: secure AJP connector
    138. [3/30]: reindex attributes
    139. [4/30]: exporting Dogtag certificate store pin
    140. [5/30]: stopping certificate server instance to update CS.cfg
    141. [6/30]: backing up CS.cfg
    142. [7/30]: disabling nonces
    143. [8/30]: set up CRL publishing
    144. [9/30]: enable PKIX certificate path discovery and validation
    145. [10/30]: starting certificate server instance
    146. [11/30]: configure certmonger for renewals
    147. [12/30]: requesting RA certificate from CA
    148. [13/30]: setting audit signing renewal to 2 years
    149. [14/30]: restarting certificate server
    150. [15/30]: publishing the CA certificate
    151. [16/30]: adding RA agent as a trusted user
    152. [17/30]: authorizing RA to modify profiles
    153. [18/30]: authorizing RA to manage lightweight CAs
    154. [19/30]: Ensure lightweight CAs container exists
    155. [20/30]: configure certificate renewals
    156. [21/30]: configure Server-Cert certificate renewal
    157. [22/30]: Configure HTTP to proxy connections
    158. [23/30]: restarting certificate server
    159. [24/30]: updating IPA configuration
    160. [25/30]: enabling CA instance
    161. [26/30]: migrating certificate profiles to LDAP
    162. [27/30]: importing IPA certificate profiles
    163. [28/30]: adding default CA ACL
    164. [29/30]: adding 'ipa' CA entry
    165. [30/30]: configuring certmonger renewal for lightweight CAs
    166. Done configuring certificate server (pki-tomcatd).
    167. Configuring directory server (dirsrv)
    168. [1/3]: configuring TLS for DS instance
    169. [2/3]: adding CA certificate entry
    170. [3/3]: restarting directory server
    171. Done configuring directory server (dirsrv).
    172. Configuring ipa-otpd
    173. [1/2]: starting ipa-otpd
    174. [2/2]: configuring ipa-otpd to start on boot
    175. Done configuring ipa-otpd.
    176. Configuring the web interface (httpd)
    177. [1/22]: stopping httpd
    178. [2/22]: setting mod_nss port to 443
    179. [3/22]: setting mod_nss cipher suite
    180. [4/22]: setting mod_nss protocol list to TLSv1.2
    181. [5/22]: setting mod_nss password file
    182. [6/22]: enabling mod_nss renegotiate
    183. [7/22]: disabling mod_nss OCSP
    184. [8/22]: adding URL rewriting rules
    185. [9/22]: configuring httpd
    186. [10/22]: setting up httpd keytab
    187. [11/22]: configuring Gssproxy
    188. [12/22]: setting up ssl
    189. [13/22]: configure certmonger for renewals
    190. [14/22]: importing CA certificates from LDAP
    191. [15/22]: publish CA cert
    192. [16/22]: clean up any existing httpd ccaches
    193. [17/22]: configuring SELinux for httpd
    194. [18/22]: create KDC proxy config
    195. [19/22]: enable KDC proxy
    196. [20/22]: starting httpd
    197. [21/22]: configuring httpd to start on boot
    198. [22/22]: enabling oddjobd
    199. Done configuring the web interface (httpd).
    200. Configuring Kerberos KDC (krb5kdc)
    201. [1/1]: installing X509 Certificate for PKINIT
    202. Done configuring Kerberos KDC (krb5kdc).
    203. Applying LDAP updates
    204. Upgrading IPA:. Estimated time: 1 minute 30 seconds
    205. [1/10]: stopping directory server
    206. [2/10]: saving configuration
    207. [3/10]: disabling listeners
    208. [4/10]: enabling DS global lock
    209. [5/10]: disabling Schema Compat
    210. [6/10]: starting directory server
    211. [7/10]: upgrading server
    212. [8/10]: stopping directory server
    213. [9/10]: restoring configuration
    214. [10/10]: starting directory server
    215. Done.
    216. Restarting the KDC
    217. Configuring DNS (named)
    218. [1/12]: generating rndc key file
    219. [2/12]: adding DNS container
    220. [3/12]: setting up our zone
    221. [4/12]: setting up reverse zone
    222. [5/12]: setting up our own record
    223. [6/12]: setting up records for other masters
    224. [7/12]: adding NS record to the zones
    225. [8/12]: setting up kerberos principal
    226. [9/12]: setting up named.conf
    227. [10/12]: setting up server configuration
    228. [11/12]: configuring named to start on boot
    229. [12/12]: changing resolv.conf to point to ourselves
    230. Done configuring DNS (named).
    231. Restarting the web server to pick up resolv.conf changes
    232. Configuring DNS key synchronization service (ipa-dnskeysyncd)
    233. [1/7]: checking status
    234. [2/7]: setting up bind-dyndb-ldap working directory
    235. [3/7]: setting up kerberos principal
    236. [4/7]: setting up SoftHSM
    237. [5/7]: adding DNSSEC containers
    238. [6/7]: creating replica keys
    239. [7/7]: configuring ipa-dnskeysyncd to start on boot
    240. Done configuring DNS key synchronization service (ipa-dnskeysyncd).
    241. Restarting ipa-dnskeysyncd
    242. Restarting named
    243. Updating DNS system records
    244. Configuring client side components
    245. Using existing certificate '/etc/ipa/ca.crt'.
    246. Client hostname: ipaserver.changchunhua.cloud
    247. Realm: CHANGCHUNHUA.CLOUD
    248. DNS Domain: changchunhua.cloud
    249. IPA Server: ipaserver.changchunhua.cloud
    250. BaseDN: dc=changchunhua,dc=cloud
    251. Skipping synchronizing time with NTP server.
    252. New SSSD config will be created
    253. Configured sudoers in /etc/nsswitch.conf
    254. Configured /etc/sssd/sssd.conf
    255. trying https://ipaserver.changchunhua.cloud/ipa/json
    256. [try 1]: Forwarding 'schema' to json server 'https://ipaserver.changchunhua.cloud/ipa/json'
    257. trying https://ipaserver.changchunhua.cloud/ipa/session/json
    258. [try 1]: Forwarding 'ping' to json server 'https://ipaserver.changchunhua.cloud/ipa/session/json'
    259. [try 1]: Forwarding 'ca_is_enabled' to json server 'https://ipaserver.changchunhua.cloud/ipa/session/json'
    260. Systemwide CA database updated.
    261. Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
    262. Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
    263. Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
    264. [try 1]: Forwarding 'host_mod' to json server 'https://ipaserver.changchunhua.cloud/ipa/session/json'
    265. SSSD enabled
    266. Configured /etc/openldap/ldap.conf
    267. Configured /etc/ssh/ssh_config
    268. Configured /etc/ssh/sshd_config
    269. Configuring changchunhua.cloud as NIS domain.
    270. Client configuration complete.
    271. The ipa-client-install command was successful
    272. ==============================================================================
    273. Setup complete
    274. Next steps:
    275. 1. You must make sure these network ports are open:
    276. TCP Ports:
    277. * 80, 443: HTTP/HTTPS
    278. * 389, 636: LDAP/LDAPS
    279. * 88, 464: kerberos
    280. * 53: bind
    281. UDP Ports:
    282. * 88, 464: kerberos
    283. * 53: bind
    284. * 123: ntp
    285. 2. You can now obtain a kerberos ticket using the command: 'kinit admin'
    286. This ticket will allow you to use the IPA tools (e.g., ipa user-add)
    287. and the web user interface.
    288. Be sure to back up the CA certificates stored in /root/cacert.p12
    289. These files are required to create replicas. The password for these
    290. files is the Directory Manager password

    9、验证freeIPA服务功能

    通过尝试为admin用户初始化kerberos令牌来验证Kerberos域是否已正确安装。

    1. [root@vm1 ~]# kinit admin
    2. Password for admin@TMP.GCE.CLOUDERA.COM:
    3. [root@ipaserver ~]# klist
    4. Ticket cache: KEYRING:persistent:0:0
    5. Default principal: admin@CHANGCHUNHUA.CLOUD
    6. Valid starting Expires Service principal
    7. 11/12/2022 02:32:36 11/13/2022 02:32:33 krbtgt/CHANGCHUNHUA.CLOUD@CHANGCHUNHUA.CLOUD

    10、验证IPA服务器是否正常运行

    1. [root@ipaserver ~]# ipa user-find admin
    2. --------------
    3. 1 user matched
    4. --------------
    5. User login: admin
    6. Last name: Administrator
    7. Home directory: /home/admin
    8. Login shell: /bin/bash
    9. Principal alias: admin@CHANGCHUNHUA.CLOUD
    10. UID: 229800000
    11. GID: 229800000
    12. Account disabled: False
    13. ----------------------------
    14. Number of entries returned 1
    15. ----------------------------

     然后我这边通过浏览器访问https://ipaserver.changchunhua.cloud/ipa/ui出现问题。

    这个问题,我估计是什么DNS的问题。更新了电脑上的DNS的配置。

    然后就能看到这个页面了。

    通过ping命令,可以解析成功。 

    使用admin的账号和配置的密码登录: 

    11、查看IPA组件状态:

    1. [root@ipaserver ~]# ipactl status
    2. Directory Service: RUNNING
    3. krb5kdc Service: RUNNING
    4. kadmin Service: RUNNING
    5. named Service: RUNNING
    6. httpd Service: RUNNING
    7. ipa-custodia Service: RUNNING
    8. ntpd Service: RUNNING
    9. pki-tomcatd Service: RUNNING
    10. ipa-otpd Service: RUNNING
    11. ipa-dnskeysyncd Service: RUNNING
    12. ipa: INFO: The ipactl command was successful
    1. [root@ipaserver ~]# ipactl --help
    2. Usage: ipactl start|stop|restart|status
    3. Options:
    4. -h, --help show this help message and exit
    5. -d, --debug Display debugging information
    6. -f, --force Force IPA to start. Combine options --skip-version-
    7. check and --ignore-service-failures
    8. --ignore-service-failures
    9. If any service start fails, do not rollback the
    10. services, continue with the operation
    11. --skip-version-check skip version check

    2023年3月6日:

    然后我这边再试着按照docker的方式来部署freeIPA:

    1. docker run --rm --name freeipa -ti \
    2. --read-only \
    3. --sysctl net.ipv6.conf.all.disable_ipv6=0 \
    4. -h ipaserver.changchunhua.cloud \
    5. -p 443:443 -p 8009:389 \
    6. -v /sys/fs/cgroup:/sys/fs/cgroup:ro \
    7. -v /data/webapps/ipa:/data:Z \
    8. freeipa/freeipa-server:centos-8-stream

     

  • 相关阅读:
    QT实现凸凹边形等距缩放
    字符串拼接re.sub()用法
    PHP GC回收机制详解
    GPT引领前沿与应用突破之GPT4科研实践技术与AI绘图
    第六届“中国法研杯”司法人工智能挑战赛
    SpringCloudGateway--Sentinel限流、熔断降级
    python中,axis=0,axis=1,axis=2的理解【对于按待定轴求和,axis=‘x’的理解】
    2022年最新前端面试题
    【华为账号服务】【FAQ】Account Kit常见咨询合集--获取帐号个人信息相关问题
    CesiumJS 源码杂谈 - 从光到 Uniform
  • 原文地址:https://blog.csdn.net/chang_chunhua/article/details/127777052