Come installare il server FreeIPA su CentOS 7/RHEL 7
In questa guida vedremo come installare il server FreeIPA su CentOS 7/RHEL 7. Una volta che FreeIPA è in esecuzione, i tuoi problemi di dover gestire manualmente gli account utente/l'autenticazione sui sistemi Linux finiranno. Inizialmente, ho utilizzato il server OpenLDAP Vanilla per la gestione delle identità, è una vera seccatura da amministrare.
Per chi è nuovo a FreeIPA, si tratta di un sistema di gestione delle identità che mira a fornire identità, policy e controllo facilmente gestibili per gli utenti.
FreeIPA è un progetto Open Source sponsorizzato da Red Hat. È a monte del Red Hat Identity Manager commerciale. Sul lato client è presente un'applicazione client utilizzata per configurare i sistemi di destinazione.
Per altri server, dai un'occhiata a:
- Come installare FreeIPA Server su Ubuntu
- Installa e configura il server FreeIPA su RHEL/CentOS 8
Installazione FreeIPA Requisiti minimi
- Server con 4 GB di RAM: ho riscontrato installazioni non riuscite per 1 GB e 2 GB di RAM
- 2 vCPU
- Porte 443 e 80 non utilizzate da un'altra applicazione
- FQDN: risolvibile su server DNS pubblico o privato
- 10 GB di spazio su disco
Installa FreeIPA Server su CentOS 7/RHEL 7
Ci sono alcune impostazioni che dobbiamo soddisfare prima di installare FreeIPA sul nostro server CentOS.
Passaggio 1: aggiorna il sistema
Aggiungerò il repository epel e aggiornerò tutti i pacchetti installati sul sistema.
sudo yum -y install epel-release
sudo yum -y update
sudo yum install bind-utils vim
Una volta aggiornato il sistema, procedi con l'installazione dei pacchetti server FreeIPA.
Passaggio 2: installa i pacchetti FreeIPA Server
I pacchetti installati dipendono dai servizi che IPA deve fornire. Se non hai bisogno del servizio DNS, installa semplicemente il pacchetto ipa-server:
sudo yum -y install ipa-server
Se desideri includere il servizio DNS, installa anche ipa-server-dns, bind e bind-dyndb-ldap:
sudo yum -y install ipa-server-dns bindipa-server bind-dyndb-ldap
Passaggio 3: configurazione del server IPA
Configurare il server FreeIPA è un processo semplice, devi solo rispondere ad alcune domande e tutto sarà configurato. Se non disponi di un server DNS per risolvere il nome host del server, modifica il file /etc/hosts per includere il nome host e l'indirizzo IP.
$ sudo vim /etc/hosts
172.16.11.20 ipa.computingforgeeks.com
Configura il nome host del server in modo che corrisponda al nome sopra:
sudo hostnamectl set-hostname ipa.computingforgeeks.com
Quindi esegui il comando ipa-server-install per configurare il server IPA. È necessario eseguirlo come utente root:
sudo ipa-server-install
Se desideri configurare anche il servizio DNS, includi l'opzione –setup-dns :
sudo ipa-server-install --setup-dns
Ti verrà richiesto di fornire risposte a una serie di domande:
$ 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.
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]:
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 [ipa.computingforgeeks.com]:
The domain name has been determined based on the host name.
Please confirm the domain name [computingforgeeks.com]:
The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.
Please provide a realm name [COMPUTINGFORGEEKS.COM]:
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):
The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.
IPA admin password:
Password (confirm):
The IPA Master Server will be configured with:
Hostname: ipa.computingforgeeks.com
IP address(es): 192.168.x.x
Domain name: computingforgeeks.com
Realm name: COMPUTINGFORGEEKS.COM
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
.....
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
UDP Ports:
* 88, 464: kerberos
* 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
...
Vuoi configurare il DNS integrato (BIND)? [no]: no –> Rispondi sì se desideri abilitare il servizio DNS (bind)
Nome host del server [ipa.computingforgeeks.com]:
Passaggio 4: configura Firewalld per FreeIPA
Se hai un servizio firewall in esecuzione, devi aprire alcune porte richieste dai servizi FreeIPA. Le porte da aprire sono:
TCP Ports:
* 80, 443: HTTP/HTTPS
* 389, 636: LDAP/LDAPS
* 88, 464: kerberos
UDP Ports:
* 88, 464: kerberos
* 123: ntp
Utilizzare i seguenti comandi per configurare firewalld:
sudo firewall-cmd --add-service={dns,freeipa-ldap,freeipa-ldaps} --permanent
sudo firewall-cmd --reload
Passaggio 5: accedi all'interfaccia Web di FreeIPA
Dopo aver aperto le porte del firewall e configurato il server FreeIPA, puoi accedere alla sua interfaccia web di amministrazione per l'amministrazione. Tutte le attività IPA possono essere eseguite sull'interfaccia web o utilizzando lo strumento da riga di comando ipa . Accedi alla dashboard di amministrazione utilizzando https://ipa.computingforgeeks.com/. Sostituisci ipa.computinforgeeks.com con il tuo nome host.
Dopo aver effettuato l'accesso, dovresti vedere un'interfaccia come quella seguente:
Per utilizzare il comando ipa, devi prima ottenere un ticket Kerberos.
$ kinit admin
Password for [email :
Controlla le informazioni sulla scadenza del biglietto utilizzando klist.
$ klist
Ticket cache: KEYRING:persistent:0:0
Default principal: [email
Valid starting Expires Service principal
06/01/2018 20:14:49 06/02/2018 20:14:44 krbtgt/[email
Prova elencando l'aggiunta di un account utente ed elencando gli account presenti:
$ sudo ipa user-add jmutai \
--first=Josphat --last=Mutai \
--em[email \
--shell=/bin/bash --password
Password:
Enter Password again to verify:
-------------------
Added user "jmutai"
-------------------
User login: jmutai
First name: Josphat
Last name: Mutai
Full name: Josphat Mutai
Display name: Josphat Mutai
Initials: JM
Home directory: /home/jmutai
GECOS: Josphat Mutai
Login shell: /bin/bash
Principal name: [email
Principal alias: [email
Email address: [email
UID: 839400001
GID: 839400001
Password: True
Member of groups: ipausers
Kerberos keys available: True
Ottieni account utente:
# ipa user-find
---------------
2 users matched
---------------
User login: admin
Last name: Administrator
Home directory: /home/admin
Login shell: /bin/bash
Principal alias: [email
UID: 839400000
GID: 839400000
Account disabled: False
User login: jmutai
First name: Josphat
Last name: Mutai
Home directory: /home/jmutai
Login shell: /bin/bash
Principal name: [email
Principal alias: [email
Email address: [email
UID: 839400001
GID: 839400001
Account disabled: False
----------------------------
Number of entries returned 2
----------------------------
Al tuo primo accesso utilizzando l'account LDAP, ti verrà chiesto di modificare la password:
$ ssh jmutai@localhost
The authenticity of host 'localhost (<no hostip for proxy command>)' can't be established.
ECDSA key fingerprint is SHA256:ZlUOPuCJMftjMABxBWAWX/CXWZEtolp2Mv84nzKDV+4.
ECDSA key fingerprint is MD5:03:61:e8:e5:21:17:98:db:96:d5:75:cb:38:c2:0a:34.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
Password:
Password expired. Change your password now.
Current Password:
New password:
Retype new password:
Could not chdir to home directory /home/jmutai: No such file or directory
Passaggio 6: proteggi il server FreeIPA con Let's Encrypt
Dopo l'installazione ti consigliamo di utilizzare SSL sicuro sul tuo server FreeIPA. Se in esecuzione su un'istanza pubblica, segui la nostra guida nel collegamento successivo:
- Proteggi il server FreeIPA con il certificato SSL Let's Encrypt
Dopo aver configurato FreeIPA Server, probabilmente vorrai configurare il client FreeIPA, per questo fai riferimento alle seguenti guide:
- Come configurare il client FreeIPA su Ubuntu/CentOS 7
Leggi anche: Come reimpostare la password amministratore di FreeIPA come utente root
Esempi di utilizzo LDAP:
- Come configurare l'autenticazione GitLab FreeIPA
- Come integrare il registro Harbour con LDAP per l'autenticazione dell'utente
- Come configurare l'autenticazione LDAP Jenkins FreeIPA