OS: RHEL 6.x / CentOS 6.x
Systemy rodziny RedHat oferują możliwość realizacji centralnej autentykacji użytkowników poprzez wykorzystanie oprogramowania typu IdM wprost z repozytorium systemowego.
Oprogramowanie udostęnia nam prosty, przejrzysty interfejs www do centralnego zarządzania użytkownikami, grupami oraz uprawnieniami na poszczególnych maszynach. Zalety takiego sposobu zarządzania dostępami przy większej ilości serwerów są oczywiste.
Instalacja IPA Server
Instalacja i działanie serwera IPA wymaga skonfigurowania hostname'a maszyny jako ( WAŻNE! ) pełnej nazwy domenowej (FQN), i dodania go do pliku /etc/hosts. Moja konfiguracja wygląda następująco:
[root@server ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server.ipa.local
GATEWAY=192.168.1.1
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=server.ipa.local
GATEWAY=192.168.1.1
[root@server ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.110 server.ipa.local server
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
192.168.1.110 server.ipa.local server
Czyli serwer nazywać się będzie server, znajdować się będzie w domenie ipa.local i mieć będzie adres 192.168.1.110.
Po skonfigurowaniu pliku hosts możemy przystąpić do właściwej instalacji:
[root@ipa-server ~]# yum -y install ipa-server
Po instalacji paczki wraz z ponad 80 zależnościami, możemy przystąpić do tworzenia instancji serwera IPA na naszej maszynie. Instalacja może odbywać się interaktywnie, jak i przez deklarację odpowiednich opcji, których przegląd dostępny jest w helpie dla samego instalatora (ipa-server-install --help). W podstawowej wersji zupełnie wystarczająca jest instalacja interaktywna, i taką przeprowadzimy:
[root@server ~]# 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)
To accept the default shown in brackets, press the Enter key.
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 [server.ipa.local]: [enter]
The domain name has been determined based on the host name.
Please confirm the domain name [ipa.local]: [enter]
The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.
Please provide a realm name [IPA.LOCAL]: [enter]
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: [haslo]
Password (confirm): [haslo]
The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.
IPA admin password: [haslo]
Password (confirm): [haslo]
The IPA Master Server will be configured with:
Hostname: server.ipa.local
IP address: 192.168.1.110
Domain name: ipa.local
Realm name: IPA.LOCAL
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.
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)
To accept the default shown in brackets, press the Enter key.
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 [server.ipa.local]: [enter]
The domain name has been determined based on the host name.
Please confirm the domain name [ipa.local]: [enter]
The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.
Please provide a realm name [IPA.LOCAL]: [enter]
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: [haslo]
Password (confirm): [haslo]
The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.
IPA admin password: [haslo]
Password (confirm): [haslo]
The IPA Master Server will be configured with:
Hostname: server.ipa.local
IP address: 192.168.1.110
Domain name: ipa.local
Realm name: IPA.LOCAL
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.
Po krótkiej ankiecie nastąpi konfiguracja niezbędnych usług jak np. ntp, serwera certyfikatów, kerberosa czy httpd do interfejsu www samego IdM-a. Jak widać powyżej, nasz serwer będzie działał w domenie ipa.local, a jego królestwem kerberosowym będzie IPA.LOCAL. (Kerberos to temat na inny tekst - przy IPA nie jest konieczna jego znajomość)
Po instalacji zostaniemy poinformowani o konieczności otwarcia portów, możliwości uzyskania ticketu kerberosowego czy zaleceniu backupu pliku klucza:
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 certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password
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 certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password
Jeśli instalacja przebiegła poprawnie, powinniśmy być w stanie uzyskać ticket kerberosa zgodnie z poprzednią informacją:
[root@server ~]# kinit admin
Password for admin@IPA.LOCAL:[haslo]
[root@server ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: admin@IPA.LOCAL
Valid starting Expires Service principal
08/27/15 19:35:15 08/28/15 19:35:11 krbtgt/IPA.LOCAL@IPA.LOCAL
Password for admin@IPA.LOCAL:[haslo]
[root@server ~]# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: admin@IPA.LOCAL
Valid starting Expires Service principal
08/27/15 19:35:15 08/28/15 19:35:11 krbtgt/IPA.LOCAL@IPA.LOCAL
Mamy ticket, więc nasza instalacja przebiegła poprawnie. Powinniśmy móc zalogować się również poprzez interfejs www, odwiedzając poprzez przeglądarkę adres IP naszego serwera IPA:
Korzystając z credentiali, jakie podaliśmy podczas instalacji IPA, logujemy się do panelu administracyjnego (user: admin):
Voila! Mamy działający serwer centralnej autoryzacji.
Troubbleshooting
Manager IPA nie otwiera się w przeglądarce po instalacji:najczęściej winy jest:
* brak otwarcia FW dla portów IPA
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 80 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 443 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 389 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 636 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 88 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 464 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 88 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 464 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 123 -j ACCEPT
[root@server ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 443 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 389 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 636 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 88 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p tcp -m tcp --dport 464 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 88 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 464 -j ACCEPT
[root@server ~]# iptables -I INPUT 5 -p udp -m udp --dport 123 -j ACCEPT
[root@server ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
* niemożność rozwiązania DNS nazwy serwera IPA
W przypadku środowisk serwerowych należy dodać odpowiednie wpisy w DNS-ach.
Dla lokalnego środowiska wirtualnego, w którym nie ma możliwości ingerencji we wpisy serwerów DNS, rozwiązaniem problemu będzie dodanie na maszynie, z której próbujemy otworzyć stronę IPA wpisu:
192.168.1.110 server.ipa.local
do pliku hosts:
* dla OS Linux w /etc/hosts
* dla OS Windows w C:\Windows\System32\drivers\etc\hosts
Brak komentarzy:
Prześlij komentarz