GNU/Linux >> LINUX-Kenntnisse >  >> Cent OS

So installieren Sie den FreeIPA-Client unter Rocky Linux/Alma Linux/CentOS 8

Diese Integrationen ermöglichen es einem Systemadministrator, den Server bequem zentral auf dem FreeIPA-Server zu konfigurieren. Wenn ein Verwaltungsbefehl auf dem Client-Rechner ausgeführt wird, sendet der FreeIPA-Client ihn an den Server, wo er ausgeführt wird.

Verwandte Inhalte

  • So verwalten Sie Benutzer und Gruppen in FreeIPA Server
  • So installieren Sie den FreeIPA-Client auf Fedora 35
  • So installieren und konfigurieren Sie FreeIPA unter Rocky Linux/Centos 8
  • So installieren und konfigurieren Sie den FreeIPA-Client unter Ubuntu 20.04
  • So konfigurieren Sie die FreeIPA-Replikation unter Rocky Linux/Alma Linux/Centos 8

Voraussetzungen

Um mitzumachen, stellen Sie sicher, dass Sie Folgendes haben

  • Ein Rocky Linux/Centos 8 oder ein beliebiger Rhel 8-basierter Server
  • Ein IPA-Server, dem der Client beitreten wird
  • Sudo-Zugriff auf den Server oder Benutzer mit Sudo-Zugriff
  • Internetzugang vom Server

Inhaltsverzeichnis

  1. FreeIPA-Pakete installieren
  2. Einrichten des Clients
  3. Aktivieren Sie die Erstellung von Home-Verzeichnissen bei der ersten Anmeldung
  4. Hinzufügen von Testclients
  5. Verwendung des FreeIPA ipa Command Line Management Tools
  6. Passwortlose Authentifizierung mit privatem Schlüssel aktivieren
  7. Rocky Linux/Alma Linux IPA-Client entfernen

1. FreeIPA-Pakete installieren

Auf dem Rocky Linux 8-Server ist der FreeIPA-Client als AppStream-Modul verfügbar. Listen Sie das Modul mit diesem Befehl auf:

$ sudo dnf module list idm

Name Stream     Profiles                               Summary
idm  DL1 [e]    adtrust, client [i], common [d], dns,  The Red Hat Enterprise Linux Identity Management system
                server                                 module
idm  client [d] common [d]                             RHEL IdM long term support client module

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Aus der Ausgabe können Sie sehen, dass wir DL1 haben und client Ströme. Führen Sie für weitere Informationen zum FreeIPA-Client-Stream Folgendes aus:

sudo dnf module info idm:DL1/client

Installieren Sie FreeIPA Client-Pakete mit diesem Befehl.

sudo dnf module -y install idm:DL1/client

Bestätigen Sie das Hinzufügen des Clients mit rpm -qi Befehl

$ rpm -qi ipa-client
Name        : ipa-client
Version     : 4.9.2
Release     : 4.module+el8.4.0+664+1636a961
Architecture: x86_64
Install Date: Fri 12 Nov 2021 08:53:52 PM EAT
Group       : Unspecified
Size        : 266180
License     : GPLv3+
Signature   : RSA/SHA256, Tue 02 Nov 2021 07:33:39 PM EAT, Key ID 15af5dac6d745a60
Source RPM  : ipa-4.9.2-4.module+el8.4.0+664+1636a961.src.rpm
Build Date  : Tue 02 Nov 2021 07:21:45 PM EAT
Build Host  : ord1-prod-x86build001.svc.aws.rockylinux.org
Relocations : (not relocatable)
Packager    : [email protected]
Vendor      : Rocky
URL         : http://www.freeipa.org/
Summary     : IPA authentication for use on clients
Description :
IPA is an integrated solution to provide centrally managed Identity (users,
hosts, services), Authentication (SSO, 2FA), and Authorization
(host access control, SELinux user roles, services). The solution provides
features for further integration with Linux based clients (SUDO, automount)
and integration with Active Directory based infrastructures (Trusts).
If your network uses IPA for authentication, this package should be
installed on every client machine.
This package provides command-line tools for IPA administrators.

2. Client einrichten

Sobald die Installation der FreeIPA Client-Pakete abgeschlossen ist. Fügen Sie den Hostnamen und die IP-Adresse Ihres IPA-Servers zu /etc/hosts  hinzu Datei, wenn Sie keine funktionierende DNS-Auflösung haben.

echo "10.2.40.149 ipa.citizix.com" | sudo tee /etc/hosts

Legen Sie Ihren System-Hostnamen fest.

sudo hostnamectl set-hostname ipa-client.citizix.com

Wir können dann den Client einrichten, indem wir den FreeIPA-Server und den Domänennamen angeben

sudo ipa-client-install --server=ipa.citizix.com --domain ipa.citizix.com

Sie können auch weitere Argumente hinzufügen, die den Hostnamen, den Server, die Domäne und den Bereich des ipa-Clients angeben, wie in diesem Beispiel.

sudo ipa-client-install --hostname=ipa-client.citizix.com \
 --mkhomedir \
 --server=ipa.citizix.com \
 --domain ipa.citizix.com \
 --realm IPA.CITIZIX.COM

Das ist meine Ausgabe. Sie sollten etwas Ähnliches sehen

# ipa-client-install --server=ipa.citizix.com --domain ipa.citizix.com
This program will set up IPA client.
Version 4.9.2

Sudo version 1.8.29
Configure options: --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr --sbindir=/usr/sbin --libdir=/usr/lib64 --docdir=/usr/share/doc/sudo --disable-root-mailer --with-logging=syslog --with-logfac=authpriv --with-pam --with-pam-login --with-editor=/bin/vi --with-env-editor --with-ignore-dot --with-tty-tickets --with-ldap --with-ldap-conf-file=/etc/sudo-ldap.conf --with-selinux --with-passprompt=[sudo] password for %p:  --with-linux-audit --with-sssd
Sudoers policy plugin version 1.8.29
Sudoers file grammar version 46

Sudoers path: /etc/sudoers
nsswitch path: /etc/nsswitch.conf
ldap.conf path: /etc/sudo-ldap.conf
ldap.secret path: /etc/ldap.secret
Authentication methods: 'pam'
Syslog facility if syslog is being used for logging: authpriv
Syslog priority to use when user authenticates successfully: notice
Syslog priority to use when user authenticates unsuccessfully: alert
Ignore '.' in $PATH
Send mail if the user is not in sudoers
Lecture user the first time they run sudo
Require users to authenticate by default
Root may run sudo
Always set $HOME to the target user's home directory
Allow some information gathering to give useful error messages
Visudo will honor the EDITOR environment variable
Set the LOGNAME and USER environment variables
Length at which to wrap log file lines (0 for no wrap): 80
Authentication timestamp timeout: 5.0 minutes
Password prompt timeout: 5.0 minutes
Number of tries to enter a password: 3
Umask to use or 0777 to use user's: 022
Path to mail program: /usr/sbin/sendmail
Flags for mail program: -t
Address to send mail to: root
Subject line for mail messages: *** SECURITY information for %h ***
Incorrect password message: Sorry, try again.
Path to lecture status dir: /var/db/sudo/lectured
Path to authentication timestamp dir: /run/sudo/ts
Default password prompt: [sudo] password for %p:
Default user to run commands as: root
Value to override user's $PATH with: /sbin:/bin:/usr/sbin:/usr/bin
Path to the editor for use by visudo: /bin/vi
When to require a password for 'list' pseudocommand: any
When to require a password for 'verify' pseudocommand: all
File descriptors >= 3 will be closed before executing a command
Reset the environment to a default set of variables
Environment variables to check for sanity:
	TZ
	TERM
	LINGUAS
	LC_*
	LANGUAGE
	LANG
	COLORTERM
Environment variables to remove:
	*=()*
	RUBYOPT
	RUBYLIB
	PYTHONUSERBASE
	PYTHONINSPECT
	PYTHONPATH
	PYTHONHOME
	TMPPREFIX
	ZDOTDIR
	READNULLCMD
	NULLCMD
	FPATH
	PERL5DB
	PERL5OPT
	PERL5LIB
	PERLLIB
	PERLIO_DEBUG
	JAVA_TOOL_OPTIONS
	SHELLOPTS
	BASHOPTS
	GLOBIGNORE
	PS4
	BASH_ENV
	ENV
	TERMCAP
	TERMPATH
	TERMINFO_DIRS
	TERMINFO
	_RLD*
	LD_*
	PATH_LOCALE
	NLSPATH
	HOSTALIASES
	RES_OPTIONS
	LOCALDOMAIN
	CDPATH
	IFS
Environment variables to preserve:
	XAUTHORITY
	_XKB_CHARSET
	LINGUAS
	LANGUAGE
	LC_ALL
	LC_TIME
	LC_TELEPHONE
	LC_PAPER
	LC_NUMERIC
	LC_NAME
	LC_MONETARY
	LC_MESSAGES
	LC_MEASUREMENT
	LC_IDENTIFICATION
	LC_COLLATE
	LC_CTYPE
	LC_ADDRESS
	LANG
	USERNAME
	QTDIR
	PS2
	PS1
	MAIL
	LS_COLORS
	KDEDIR
	HISTSIZE
	HOSTNAME
	DISPLAY
	COLORS
Locale to use while parsing sudoers: C
Compress I/O logs using zlib
Directory in which to store input/output logs: /var/log/sudo-io
File in which to store the input/output log: %{seq}
Add an entry to the utmp/utmpx file when allocating a pty
PAM service name to use: sudo
PAM service name to use for login shells: sudo-i
Attempt to establish PAM credentials for the target user
Create a new PAM session for the command to run in
Perform PAM account validation management
Maximum I/O log sequence number: 0
Enable sudoers netgroup support
Check parent directories for writability when editing files with sudoedit
Query the group plugin for unknown system groups
Allow commands to be run even if sudo cannot write to the audit log
Allow commands to be run even if sudo cannot write to the log file
Resolve groups in sudoers and match on the group ID, not the name
Log entries larger than this value will be split into multiple syslog messages: 960
File mode to use for the I/O log files: 0600
Execute commands by file descriptor instead of by path: digest_only
Type of authentication timestamp record: tty
Ignore case when matching user names
Ignore case when matching group names
Log when a command is allowed by sudoers
Log when a command is denied by sudoers
Don't pre-resolve all group names

Local IP address and netmask pairs:
	10.2.40.72/255.255.255.0
	10.88.0.1/255.255.0.0
	fe80::863:3cff:fec2:9a33/ffff:ffff:ffff:ffff::
	fe80::c894:28ff:fe0e:4b89/ffff:ffff:ffff:ffff::
	fe80::5857:74ff:fe85:d86d/ffff:ffff:ffff:ffff::
	fe80::9896:7dff:fef6:b3be/ffff:ffff:ffff:ffff::
	fe80::1445:1aff:fe2e:d9dd/ffff:ffff:ffff:ffff::

Sudoers I/O plugin version 1.8.29
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
Do you want to configure chrony with NTP server or pool address? [no]: no
Client hostname: ipa-replica.citizix.com
Realm: IPA.CITIZIX.COM
DNS Domain: ipa.citizix.com
IPA Server: ipa.citizix.com
BaseDN: dc=ipa,dc=citizix,dc=com

Continue to configure the system with these values? [no]: yes
Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
User authorized to enroll computers: admin
Password for [email protected]:
Successfully retrieved CA cert
    Subject:     CN=Certificate Authority,O=IPA.CITIZIX.COM
    Issuer:      CN=Certificate Authority,O=IPA.CITIZIX.COM
    Valid From:  2021-11-09 05:42:01
    Valid Until: 2041-11-09 05:42:01

Enrolled in IPA realm IPA.CITIZIX.COM
Created /etc/ipa/default.conf
Configured sudoers in /etc/authselect/user-nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm IPA.CITIZIX.COM
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Could not update DNS SSHFP records.
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring ipa.citizix.com as NIS domain.
Client configuration complete.
The ipa-client-install command was successful

3. Aktivieren Sie die Erstellung von Home-Verzeichnissen bei der ersten Anmeldung

Wenn das Home-Verzeichnis des Nutzers nicht automatisch erstellt wird, aktivieren Sie diese Funktion, indem Sie den folgenden Befehl ausführen. Dadurch wird bei der ersten Anmeldung ein Home-Verzeichnis erstellt.

# authselect enable-feature with-mkhomedir
Make sure that SSSD service is configured and enabled. See SSSD documentation for more information.

- with-mkhomedir is selected, make sure pam_oddjob_mkhomedir module
  is present and oddjobd service is enabled and active
  - systemctl enable --now oddjobd.service

# systemctl enable --now oddjobd
Created symlink /etc/systemd/system/multi-user.target.wants/oddjobd.service → /usr/lib/systemd/system/oddjobd.service.

4. Test-Client-Zusatz

Um zu testen, ob der Client erfolgreich hinzugefügt wurde, melden wir uns mit einem Benutzer in freeipa an. Wenn Sie sich zum ersten Mal anmelden, sollten Sie eine Aufforderung zum Ändern des Passworts sehen, andernfalls sehen Sie Folgendes:

$ ssh [email protected]
([email protected]) Password:
Activate the web console with: systemctl enable --now cockpit.socket

Last login: Fri Nov 12 21:03:32 2021 from 10.2.40.10
[[email protected] ~]$

5. Verwendung des FreeIPA ipa Command Line Management Tools

Sie können FreeIPA Server vom Client-Rechner aus mit dem ipa-Befehlszeilentool verwalten.

Fordern Sie zunächst ein Kerberos-Ticket an.

$ kinit admin
Password for [email protected]:

Überprüfen Sie die Informationen zum Ticketablauf mit klist.

$ klist
Ticket cache: KCM:1000
Default principal: [email protected]

Valid starting       Expires              Service principal
11/12/2021 21:27:59  11/13/2021 21:27:47  krbtgt/[email protected]

Testen Sie, indem Sie ein Benutzerkonto hinzufügen und vorhandene Konten auflisten:

$ sudo ipa user-add kip \
     --first=Kipkoech \
     --last=Towett \
     [email protected] \
     --password

Password:
Enter Password again to verify:
----------------
Added user "kip"
----------------
  User login: kip
  First name: Kipkoech
  Last name: Towett
  Full name: Kipkoech Towett
  Display name: Kipkoech Towett
  Initials: KT
  Home directory: /home/kip
  GECOS: Kipkoech Towett
  Login shell: /bin/bash
  Principal name: [email protected]
  Principal alias: [email protected]
  User password expiration: 20211112183007Z
  Email address: [email protected]
  UID: 1063800003
  GID: 1063800003
  Password: True
  Member of groups: ipausers
  Kerberos keys available: True

Bestätigen.

$ ipa user-find kip
--------------
1 user matched
--------------
  User login: kip
  First name: Kipkoech
  Last name: Towett
  Home directory: /home/kip
  Login shell: /bin/bash
  Principal name: [email protected]
  Principal alias: [email protected]
  Email address: [email protected]
  UID: 1063800003
  GID: 1063800003
  Account disabled: False
----------------------------
Number of entries returned 1
----------------------------

6. Aktivieren Sie die passwortlose Authentifizierung mit privatem Schlüssel

Wenn Sie sich ohne Passwort bei einem Server authentifizieren möchten, kopieren Sie Ihren öffentlichen Schlüssel auf den FreeIPA-Server. Klicken Sie im Nutzerprofil auf Hinzufügen  Schaltfläche unter „Öffentliche SSH-Schlüssel “, fügen Sie Ihren öffentlichen Schlüssel in das Feld ein und speichern Sie.

7. Rocky Linux/Alma Linux IPA-Client entfernen

Das Entfernen des FreeIPA-Clients auf Rocky Linux/Alma Linux 8 kann durch Ausführen des folgenden Befehls erfolgen:

$ sudo ipa-client-install  --uninstall

Schlussfolgerung

In diesem Handbuch ist es uns gelungen, den FreeIPA-Client auf einem Rocky Linux/Almas Linux/Centos 8-Server zu installieren und einzurichten.


Cent OS
  1. So debootstrap auf CentOS Linux

  2. So installieren Sie Mysql 8 auf Rocky Linux/Centos 8

  3. So installieren und konfigurieren Sie Redis 6 unter Rocky Linux/Centos 8

  4. So installieren Sie Java 17 auf Rocky Linux 8/Centos 8

  5. So installieren Sie PHP 8 auf Alma Linux &Rocky Linux

So installieren Sie Apache Maven unter Rocky Linux / CentOS 8

So installieren Sie Spotify unter CentOS 8 / Rocky Linux

So installieren Sie Rabbitmq in Rocky Linux/Alma Linux/Centos 8

So installieren und konfigurieren Sie FreeIPA unter Rocky Linux/Centos 8

So konfigurieren Sie die FreeIPA-Replikation unter Rocky Linux/Alma Linux/Centos 8

So installieren Sie FreeIPA unter Rocky Linux 8