Төхөөрөмжийг Active Directory-д нэгтгэх — 3-р хэсэг: Алдаа: ERROR_BAD_COMMAND [code 0x00000016]
Энэ хуудсыг AI-аар орчуулж, автоматаар шалгасан. Нарийн тохиргоо хийхээсээ өмнө англи эхтэй тулгаж болно.
Error: ERROR_BAD_COMMAND [code 0x00000016]
Энэ нь алдаа биш, төхөөрөмж амжилттай нэгдсэн.
# /opt/pbis/bin/domainjoin-cli join example.local administrator
Joining to AD Domain: example.local
With Computer DNS Name: bdvm-c8x64.example.local
administrator@EXAMPLE.LOCAL's password:
Warning: A resumable error occurred while processing the 'hostname' module
ERROR_BAD_COMMAND [code 0x00000016]
Warning: System restart required
Your system has been configured to authenticate to Active Directory for the first time. It is
recommended that you restart your system to ensure that all applications recognize the new settings.
SUCCESSError: DNS_ERROR_BAD_PACKET [code 0x0000251e]
# /opt/pbis/bin/domainjoin-cli join example.local administrator
Joining to AD Domain: example.local
With Computer DNS Name: o7x64tl.example.local
administrator@EXAMPLE.LOCAL's password:
Error: DNS_ERROR_BAD_PACKET [code 0x0000251e]
A bad packet was received from a DNS server. Potentially the requested address does not exist.Шийдэл
- Domain Controller (DC) ping-д хариу өгч байгаа эсэхийг шалгана.
# ping example.local Computer-ийн DNS нь Domain Controller-ийн IP хаяг руу заасан эсэхийг шалгана./etc/nsswitch.confфайлдhostsмэдээллийн сангийн хайлтын дараалал эхлээдfiles, дараа ньdnsбайгаа эсэхийг шалгана./etc/resolv.confфайлд дараахийг нэмнэ.search example.local nameserver 11.11.11.11
SSSD ашиглан домэйнд нэгтгэх үеийн асуудал шийдэх
Энэ хэсэгт SSSD ашиглан Active Directory домэйнд нэгтгэх явцад гарч болох алдаануудыг жагсаав.
Жишээний утгууд:
Realm: example.local
Domain User: administrator
Domain IP: 11.11.11.11Error: Failed to join domain: failed to lookup DC info for domain 'example.local' over rpc: The attempted logon is invalid. This is either due to a bad username or authentication information.
Энэ алдаа хэрэглэгчийн нэр эсвэл нууц үг буруу байгаагаас гарна.
# realm join example.local -U administrator -v
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
Password for administrator:
* Required files: /usr/sbin/oddjobd, /usr/libexec/oddjob/mkhomedir, /usr/sbin/sssd, /usr/bin/net
* LANG=C LOGNAME=root /usr/bin/net -s /var/cache/realmd/realmd-smb-conf.0HT7S1 -U administrator ads join example.local
Enter administrator's password:
Failed to join domain: failed to lookup DC info for domain 'example.local' over rpc: The attempted logon is invalid. This is either due to a bad username or authentication information.
! Joining the domain example.local failed
realm: Couldn't join realm: Joining the domain example.local failedШийдэл
- Командыг дахин ажиллуулж, зөв нэвтрэх мэдээллээ оруулна.
Error: ! Failed to enroll machine in realm: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit is masked.
Энэ алдаа шаардлагатай багцууд суулгагдаагүйгээс гарна.
# realm join example.local -U administrator -v
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
Password for administrator:
* Couldn't find file: /usr/bin/net
* Required files: /usr/sbin/oddjobd, /usr/libexec/oddjob/mkhomedir, /usr/sbin/sssd, /usr/bin/net
* Resolving required packages
! Failed to enroll machine in realm: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit is masked.
realm: Couldn't join realm: Failed to enroll machine in realm. See diagnostics.Шийдэл
- Дараах командыг ажиллуулна.
# yum install samba-common-tools realmd oddjob oddjob-mkhomedir sssd adcli krb5-workstation
Error: No results: example.local
Active Directory (AD)-д discover командыг ажиллуулахад realm танигдах боловч үр дүн гарахгүй байна.
# sudo realm -v discover example.local
sudo: unable to resolve host user-market-2: Connection timed out
* Resolving: _ldap._tcp.example.local
* Resolving: example.local
* No results: example.local
example.local
type: kerberos
realm-name: EXAMPLE.LOCAL
domain-name: example.local
configured: noШийдэл
Асуудлыг шийдэхийн тулд:
- Виртуал машины огноо, цаг Active Directory-той синхрон эсэхийг шалгана.
- Active Directory-той ижил цагийн бүс, огноо, цаг тохируулна.
- Domain Controller ping-д хариу өгч байгаа эсэхийг шалгана.
# ping example.local Computer-ийн DNS нь Domain Controller-ийн IP хаяг руу заасан эсэхийг шалгана./etc/nsswitch.confфайлдhostsмэдээллийн сангийн хайлтын дараалал эхлээдfiles, дараа ньdnsбайгаа эсэхийг шалгана.hosts: files dns mdns4_minimal [NOTFOUND=return]
Error: realm: No such realm found: example.local
Active Directory (AD)-д discover командыг ажиллуулахад realm-ийг танихгүй байна.
# sudo realm -v discover example.local
sudo: unable to resolve host user-market-2: No such file or directory
* Resolving: _ldap._tcp.example.local
* Resolving: example.local
* No results: example.local
realm: No such realm found: example.localШийдэл
/etc/resolv.confфайлд дараахийг нэмнэ.search example.local nameserver 11.11.11.11/etc/nsswitch.confфайлдhosts:мөрийнfiles-ийн дарааdnsбайгааг шалгана.hosts: files dns myhostname- ping командыг ажиллуулна.
# ping example.local
Error: Couldn't authenticate as: Administrator@EXAMPLE.LOCAL: Preauthentication failed
# sudo realm -v join example.local
sudo: unable to resolve host user-market-2: Connection timed out
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
Password for Administrator:
* Unconditionally checking packages
* Resolving required packages
* LANG=C /usr/sbin/adcli join --verbose --domain example.local --domain-realm EXAMPLE.LOCAL --domain-controller 11.11.11.--login-type user --login-user Administrator --stdin-password
* Using domain name: example.local
* Calculated computer account name from fqdn: USER-MARKET-2
* Using domain realm: example.local
* Sending netlogon pings to domain controller: cldap://11.11.11.11
* Received NetLogon info from: DC.example.local
* Wrote out krb5.conf snippet to /var/cache/realmd/adcli-krb5-2lGxqJ/krb5.d/adcli-krb5-conf-ophiP9
! Couldn't authenticate as: Administrator@EXAMPLE.LOCAL: Preauthentication failed
adcli: couldn't connect to example.local domain: Couldn't authenticate as: Administrator@EXAMPLE.LOCAL: Preauthentication failed
! Failed to join the domain
realm: Couldn't join realm: Failed to join the domainШийдэл
- Administrator бүртгэлийн нууц үгийг зөв оруулсан эсэхээ шалгаад командыг дахин ажиллуулна.
Error: Failed to enroll machine in realm: The following packages have unmet dependencies:
# sudo realm -v join example.local
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
* Unconditionally checking packages
* Resolving required packages
* Installing necessary packages: sssd-tools, sssd, libnss-sss, libpam-sss
! Failed to enroll machine in realm: The following packages have unmet dependencies:
sssd-tools: Depends: libc6 (>= 2.12) but 2.19-0ubuntu6.15 is to be installed
Depends: libpopt0 (>= 1.14) but 1.16-8ubuntu1 is to be installed
Depends: libselinux1 (>= 1.32) but 2.2.2-1ubuntu0.1 is to be installed
Depends: libsemanage1 (>= 2.0.3) but 2.2-1 is to be installed
Depends: libtalloc2 (>= 2.0.4~git20101213) but 2.1.5-0ubuntu0.14.04.1 is to be installed
Depends: sssd-common (= 1.11.5-1ubuntu3) but 1.11.8-0ubuntu0.7 is to be installed
realm: Couldn't join realm: Failed to enroll machine in realm. See diagnostics.Шийдэл
- Дараах командуудыг ажиллуулж багцуудыг шинэчилнэ.
# apt update # sudo apt install sssd-ad sssd-tools realmd adcli
Error: KDC or realm is unreachable or can't resolve address
Энэ асуудал CentOS 6-г SSSD ашиглан Active Directory-д нэгтгэх үед гарна.
"errors": [
{
"description": "failed to generate credentials cache file for keytab file: default",
"message": "KDC or realm is unreachable or can't resolve address"
}
],Шийдэл
- Дараах командыг ажиллуулна.
# authconfig \ --enablekrb5 \ --krb5kdc=example.local \ --krb5adminserver=example.local \ --krb5realm=EXAMPLE.LOCAL \ --enablesssd \ --enablesssdauth \ --update krb5.confфайлыг шалгана. Файл дараах хэлбэртэй байх ёстой.[libdefaults] default_realm = EXAMPLE.LOCAL dns_lookup_kdc = true forwardable = true default_ccache_name = FILE:/tmp/krb5cc_%{uid} [realms] EXAMPLE.LOCAL = { admin_server = EXAMPLE.LOCAL #kdc = dc1.EXAMPLE.LOCAL #kdc = dc2.EXAMPLE.LOCAL } [logging] kdc = FILE:/var/log/krb5/krb5kdc.log admin_server = FILE:/var/log/krb5/kadmind.log default = SYSLOG:NOTICE:DAEMON [domain_realm] .EXAMPLE.LOCAL = EXAMPLE.LOCAL EXAMPLE.LOCAL = EXAMPLE.LOCAL
Error: Cannot find a valid baseurl for repo: base
Энэ асуудал CentOS 6 дээр, үйлдлийн систем нь ашиглалтын хугацаа дуусч буйтай холбоотойгоор гарна.
# yum install adcli krb5-workstation sssd
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: baseШийдэл
/etc/yum.repos.d/хавтсанд шинэ repo файл үүсгэж дараахийг нэмнэ.[C6.10-base] name=CentOS-6.10 - Base baseurl=http://vault.epel.cloud/6.10/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=1 metadata_expire=never [C6.10-updates] name=CentOS-6.10 - Updates baseurl=http://vault.epel.cloud/6.10/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=1 metadata_expire=never [C6.10-extras] name=CentOS-6.10 - Extras baseurl=http://vault.epel.cloud/6.10/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=1 metadata_expire=never [C6.10-contrib] name=CentOS-6.10 - Contrib baseurl=http://vault.epel.cloud/6.10/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 metadata_expire=never [C6.10-centosplus] name=CentOS-6.10 - CentOSPlus baseurl=http://vault.epel.cloud/6.10/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 metadata_expire=never- Багцуудыг шинэчилж, командыг дахин ажиллуулна.
# yum update # yum install adcli krb5-workstation sssd
Error: adcli: couldn't connect to domain: Couldn't get kerberos ticket ... Clock skew too great
Энэ асуудал төхөөрөмжийн огноо, цаг Active Directory-оос зөрүүтэй үед гарна.
# adcli join example.local
Password for Administrator@EXAMPLE.LOCAL:
adcli: couldn't connect to example.local domain: Couldn't get kerberos ticket for: Administrator@EXAMPLE.LOCAL: Clock skew too greatШийдэл
- Төхөөрөмж дээр Active Directory-той ижил цагийн бүс, огноо, цаг тохируулна.
Error: gss_init_sec_context failed with [ Miscellaneous failure (see text): Clock skew too great]
Энэ асуудал төхөөрөмжийн огноо, цаг Active Directory-оос зөрүүтэй үед гарна.
# sudo realm -v join example.local
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
* Unconditionally checking packages
* Resolving required packages
* LANG=C /usr/sbin/adcli join --verbose --domain example.local --domain-realm EXAMPLE.LOCAL --domain-controller 11.11.11.11 --login-type computer --no-password
* Using domain name: example.local
* Calculated computer account name from fqdn: BDVMU14X86
* Using domain realm: example.local
* Sending netlogon pings to domain controller: cldap://11.11.11.11
* Received NetLogon info from: DC.example.local
* Wrote out krb5.conf snippet to /var/cache/realmd/adcli-krb5-ffDXAr/krb5.d/adcli-krb5-conf-YCJvaP
! Couldn't authenticate as machine account: BDVMU14X86: Client 'BDVMU14X86$@EXAMPLE.LOCAL' not found in Kerberos database
adcli: couldn't connect to example.local domain: Couldn't authenticate as machine account: BDVMU14X86: Client 'BDVMU14X86$@EXAMPLE.LOCAL' not found in Kerberos database
! Unable to automatically join the domain
Password for Administrator:
* Unconditionally checking packages
* Resolving required packages
* LANG=C LOGNAME=root /usr/bin/net -s /var/cache/realmd/realmd-smb-conf.PF1JS1 -U Administrator ads join example.local
Enter Administrator's password:gss_init_sec_context failed with [ Miscellaneous failure (see text): Clock skew too great]
kinit succeeded but ads_sasl_spnego_gensec_bind(KRB5) failed: An internal error occurred.
Failed to join domain: failed to connect to AD: An internal error occurred.
! Joining the domain example.local failed
realm: Couldn't join realm: Joining the domain example.local failedШийдэл
- Төхөөрөмж дээр Active Directory-той ижил цагийн бүс, огноо, цаг тохируулна.
Error: Failed to enroll machine in realm: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit is masked.
Энэ алдаа шаардлагатай багцууд суулгагдаагүйгээс гарна.
# realm join example.local -U administrator -v
* Resolving: _ldap._tcp.example.local
* Performing LDAP DSE lookup on: 11.11.11.11
* Successfully discovered: example.local
Password for administrator:
* Couldn't find file: /usr/bin/net
* Required files: /usr/sbin/oddjobd, /usr/libexec/oddjob/mkhomedir, /usr/sbin/sssd, /usr/bin/net
* Resolving required packages
! Failed to enroll machine in realm: GDBus.Error:org.freedesktop.systemd1.UnitMasked: Unit is masked.
realm: Couldn't join realm: Failed to enroll machine in realm. See diagnostics.Шийдэл
- Дутуу багцуудыг дараах командаар суулгана.
# yum install samba-common-tools realmd oddjob oddjob-mkhomedir sssd adcli krb5-workstation
Error: Failed to start System Security Services Daemon status=4 /NOPERMISSION
/etc/sssd/sssd.conf файлын эрх буруу тохируулагдсанаас sssd үйлчилгээ эхлэх боломжгүй байна.
# systemctl start sssd
Job for sssd.service failed because the control process exited with error code.
See "systemctl status sssd.service" and "journalctl -xe" for details.
# systemctl status sssd.service
● sssd.service - System Security Services Daemon
Loaded: loaded (/usr/lib/systemd/system/sssd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-09-21 22:08:34 EEST; 5s ago
Process: 9457 ExecStart=/usr/sbin/sssd -i ${DEBUG_LOGGER} (code=exited, status=4)
Main PID: 9457 (code=exited, status=4)
Sep 21 22:08:34 slesl15gia systemd[1]: Starting System Security Services Daemon...
Sep 21 22:08:34 slesl15gia sssd[9457]: Cannot read config file /etc/sssd/sssd.conf. Please chec
k that the file is accessible only by the owner and owned by root.root.
Sep 21 22:08:34 slesl15gia systemd[1]: sssd.service: Main process exited, code=exited, status=4
/NOPERMISSION
Sep 21 22:08:34 slesl15gia systemd[1]: Failed to start System Security Services Daemon.
Sep 21 22:08:34 slesl15gia systemd[1]: sssd.service: Unit entered failed state.
Sep 21 22:08:34 slesl15gia systemd[1]: sssd.service: Failed with result 'exit-code'.Шийдэл
/etc/sssd/sssd.confфайлд600эрх олгоод эхлүүлэх командыг дахин ажиллуулна.# chmod 600 /etc/sssd/sssd.conf # systemctl start sssd
Error: adcli: joining domain example.local failed: Couldn't lookup computer account. Can't contact LDAP server
Төхөөрөмж LDAP сервертэй холбогдож чадахгүй байна.
# adcli join -D example.local -U administrator
Password for administrator@EXAMPLE.LOCAL:
adcli: joining domain example.local failed: Couldn't lookup computer account: SGIA12$: Can't contact LDAP serverШийдэл
- LDAP клиентийг тохируулна.
# zypper in openldap2-client cyrus-sasl-gssapi /etc/openldap/ldap.confфайлд дараах мөрүүдийг нэмнэ.URI ldap://example.local BASE dc=example,dc=local REFERRALS OFF
Error: authconfig: Authentication module /usr/lib64/security/pam_krb5.so is missing. Authentication process might not work correctly.
authconfig команд шаардлагатай so файл байхгүйгээс ажиллахгүй байна.
# authconfig \
--enablekrb5 \
--krb5kdc=example.local \
--krb5adminserver=example.local \
--krb5realm=EXAMPLE.LOCAL \
--enablesssd \
--enablesssdauth \
--update
authconfig: Authentication module /usr/lib64/security/pam_krb5.so is missing. Authentication process might not work correctly.Шийдэл
- Дутуу багцыг суулгана.
# yum install pam5_krb
Энэ хуудсанд гарсан нэр томъёо
- Endpoint
- Хамгаалж буй компьютер, сервер, виртуал машин
