RHEL 6.x / CentOS 6.x
Aby aktywnie wykorzystywać możliwości centralnej autentykacji na naszych serwerach konieczne będzie zainstalowanie klienta IPA, oraz podłączenie go do domeny, którą stworzyliśmy przy okazji instalacji serwera IdM-owego.
Podłączanie rozpoczniemy od instalacji pakietów klienta:
[root@ipaclient1 ~]# yum install ipa-client
Tak, jak w przypadku instalacji ipa-server mamy możliwość instalacji klienta poprzez parametyzację lub interaktywnie odpowiadając na pytania instalatora.
Niestety instalator nie zadaje nam jednego istotnego pytania, dotyczącego tworzenia katalogów domowych dla użytkowników logujących się przy użyciu kont IPA, dlatego ten element trzeba podać podczas instalacji jako parametr.
Instalator podłącza się do serwera centralnego, aby uzyskać autoryzację, dlatego przed uruchomieniem procesu warto wybić w naszym firewallu dziurki komunikacyjne:
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=80 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=88 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=389 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=88 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=464 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=464 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=123 -j ACCEPT
[root@ipaclient1 ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=88 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=389 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=88 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p tcp -m tcp --dport=464 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=464 -j ACCEPT
[root@ipaclient1 ~]# iptables -I INPUT 5 -p udp -m udp --dport=123 -j ACCEPT
[root@ipaclient1 ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
Warto również, jeśli nie korzystamy z serwera DNS dodać lokalnie w /etc/hosts dodać wpis serwera IPA
[root@ipaclient1 ~]# echo "192.168.1.110 server.ipa.local" >> /etc/hosts
Sama instalacja przebiega następująco:
[root@ipaclient1 ~]# ipa-client-install --mkhomedir
DNS discovery failed to determine your DNS domain
Provide the domain name of your IPA server (ex: example.com): ipa.local
Provide your IPA server name (ex: ipa.example.com): server.ipa.local
The failure to use DNS to find your IPA server indicates that your resolv.conf file is not properly configured.
Autodiscovery of servers for failover cannot work with this configuration.
If you proceed with the installation, services will be configured to always access the discovered server for all operations and will not fail over to other servers in case of failure.
Proceed with fixed values and no DNS discovery? [no]: yes
Hostname: ipaclient1.example.com
Realm: IPA.LOCAL
DNS Domain: ipa.local
IPA Server: server.ipa.local
BaseDN: dc=ipa,dc=local
Continue to configure the system with these values? [no]: yes
User authorized to enroll computers: admin
Synchronizing time with KDC...
Unable to sync time with IPA NTP server, assuming the time is in sync. Please check that 123 UDP port is opened.
Password for admin@IPA.LOCAL:[haslo]
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=IPA.LOCAL
Issuer: CN=Certificate Authority,O=IPA.LOCAL
Valid From: Thu Aug 27 17:26:30 2015 UTC
Valid Until: Mon Aug 27 17:26:30 2035 UTC
Enrolled in IPA realm IPA.LOCAL
Attempting to get host TGT...
Created /etc/ipa/default.conf
New SSSD config will be created
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm IPA.LOCAL
trying https://server.ipa.local/ipa/xml
Forwarding 'env' to server u'https://server.ipa.local/ipa/xml'
Hostname (ipaclient1.example.com) not found in DNS
Failed to update DNS records.
Adding SSH public key from /etc/ssh/ssh_host_dsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Forwarding 'host_mod' to server u'https://server.ipa.local/ipa/xml'
Could not update DNS SSHFP records.
SSSD enabled
Configuring ipa.local as NIS domain
Configured /etc/openldap/ldap.conf
NTP enabled
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Client configuration complete.
DNS discovery failed to determine your DNS domain
Provide the domain name of your IPA server (ex: example.com): ipa.local
Provide your IPA server name (ex: ipa.example.com): server.ipa.local
The failure to use DNS to find your IPA server indicates that your resolv.conf file is not properly configured.
Autodiscovery of servers for failover cannot work with this configuration.
If you proceed with the installation, services will be configured to always access the discovered server for all operations and will not fail over to other servers in case of failure.
Proceed with fixed values and no DNS discovery? [no]: yes
Hostname: ipaclient1.example.com
Realm: IPA.LOCAL
DNS Domain: ipa.local
IPA Server: server.ipa.local
BaseDN: dc=ipa,dc=local
Continue to configure the system with these values? [no]: yes
User authorized to enroll computers: admin
Synchronizing time with KDC...
Unable to sync time with IPA NTP server, assuming the time is in sync. Please check that 123 UDP port is opened.
Password for admin@IPA.LOCAL:[haslo]
Successfully retrieved CA cert
Subject: CN=Certificate Authority,O=IPA.LOCAL
Issuer: CN=Certificate Authority,O=IPA.LOCAL
Valid From: Thu Aug 27 17:26:30 2015 UTC
Valid Until: Mon Aug 27 17:26:30 2035 UTC
Enrolled in IPA realm IPA.LOCAL
Attempting to get host TGT...
Created /etc/ipa/default.conf
New SSSD config will be created
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm IPA.LOCAL
trying https://server.ipa.local/ipa/xml
Forwarding 'env' to server u'https://server.ipa.local/ipa/xml'
Hostname (ipaclient1.example.com) not found in DNS
Failed to update DNS records.
Adding SSH public key from /etc/ssh/ssh_host_dsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Forwarding 'host_mod' to server u'https://server.ipa.local/ipa/xml'
Could not update DNS SSHFP records.
SSSD enabled
Configuring ipa.local as NIS domain
Configured /etc/openldap/ldap.conf
NTP enabled
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Client configuration complete.
Instalator nie zwrócił błędu, więc przetestujmy, czy podłączenie przebiegło pomyślnie:
[root@ipaclient1 ~]# id
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@ipaclient1 ~]# getent passwd admin
admin:*:418600000:418600000:Administrator:/home/admin:/bin/bash
[root@ipaclient1 ~]# id admin
uid=418600000(admin) gid=418600000(admins) groups=418600000(admins)
uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[root@ipaclient1 ~]# getent passwd admin
admin:*:418600000:418600000:Administrator:/home/admin:/bin/bash
[root@ipaclient1 ~]# id admin
uid=418600000(admin) gid=418600000(admins) groups=418600000(admins)
Jak widać, lokalnie jesteśmy zalogowani na root-a, ale możemy pobrać dane identyfikacyjne usera admin, który jest userem rejestrowanym jedynie w IPA.
Od tego momentu możemy również logować się użytkownikami IdM, np. na wywołanego wcześniej admina:
login as: admin
admin@192.168.1.111's password:[haslo]
Creating home directory for admin.
[admin@ipaclient1 ~]$ id
uid=418600000(admin) gid=418600000(admins) groups=418600000(admins) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
admin@192.168.1.111's password:[haslo]
Creating home directory for admin.
[admin@ipaclient1 ~]$ id
uid=418600000(admin) gid=418600000(admins) groups=418600000(admins) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
Nasz host jest już również widoczny w panelu administracyjnym IPA:
Brak komentarzy:
Prześlij komentarz