20.10. sudo에 대한 GSSAPI 인증 문제 해결

IdM에서 Kerberos 티켓을 사용하여 sudo 서비스를 인증할 수 없는 경우 다음 시나리오를 사용하여 구성 문제를 해결합니다.

사전 요구 사항

절차

  • 다음 오류가 표시되면 Kerberos 서비스에서 호스트 이름을 기반으로 서비스 티켓에 대한 올바른 영역을 확인할 수 없습니다.

    Server not found in Kerberos database

    이 경우 /etc/krb5.conf Kerberos 구성 파일의 [domain_realm] 섹션에 직접 호스트 이름을 추가합니다.

    [idm-user@idm-client ~]$ cat /etc/krb5.conf
    ...
    
    [domain_realm]
     .example.com = EXAMPLE.COM
     example.com = EXAMPLE.COM
     server.example.com = EXAMPLE.COM
  • 다음 오류가 표시되면 Kerberos 인증 정보가 없습니다.

    No Kerberos credentials available

    이 경우 kinit 유틸리티를 사용하여 Kerberos 인증 정보를 검색하거나 SSSD로 인증합니다.

    [idm-user@idm-client ~]$ kinit idm-user@IDM.EXAMPLE.COM
    Password for idm-user@idm.example.com:
  • /var/log/sssd/sssd_pam.log 로그 파일에 다음 중 하나가 표시되면 Kerberos 자격 증명이 현재 로그인한 사용자의 사용자 이름과 일치하지 않습니다.

    User with UPN [<UPN>] was not found.
    
    UPN [<UPN>] does not match target user [<username>].

    이 경우 SSSD로 인증했는지 또는 /etc/sssd/sssd.conf 파일에서 pam_gssapi_check_upn 옵션을 비활성화하는 것이 좋습니다.

    [idm-user@idm-client ~]$ cat /etc/sssd/sssd.conf
    ...
    
    pam_gssapi_check_upn = false
  • 추가 문제 해결을 위해 pam_sss_gss.so PAM 모듈에 대한 디버깅 출력을 활성화할 수 있습니다.

    • PAM 파일의 모든 pam_sss_gss.so 항목(예: /etc/pam.d/ sudo 및 /etc/pam.d/sudo -i)의 끝에 debug 옵션을 추가합니다.

      [root@idm-client ~]# cat /etc/pam.d/sudo
      #%PAM-1.0
      auth       sufficient   pam_sss_gss.so   debug
      auth       include      system-auth
      account    include      system-auth
      password   include      system-auth
      session    include      system-auth
      [root@idm-client ~]# cat /etc/pam.d/sudo-i
      #%PAM-1.0
      auth       sufficient   pam_sss_gss.so   debug
      auth       include      sudo
      account    include      sudo
      password   include      sudo
      session    optional     pam_keyinit.so force revoke
      session    include      sudo
    • pam_sss_gss.so 모듈로 인증을 시도하고 콘솔 출력을 검토합니다. 이 예제에서 사용자에게 Kerberos 자격 증명이 없습니다.

      [idm-user@idm-client ~]$ sudo ls -l /etc/sssd/sssd.conf
      pam_sss_gss: Initializing GSSAPI authentication with SSSD
      pam_sss_gss: Switching euid from 0 to 1366201107
      pam_sss_gss: Trying to establish security context
      pam_sss_gss: SSSD User name: idm-user@idm.example.com
      pam_sss_gss: User domain: idm.example.com
      pam_sss_gss: User principal:
      pam_sss_gss: Target name: host@idm.example.com
      pam_sss_gss: Using ccache: KCM:
      pam_sss_gss: Acquiring credentials, principal name will be derived
      pam_sss_gss: Unable to read credentials from [KCM:] [maj:0xd0000, min:0x96c73ac3]
      pam_sss_gss: GSSAPI: Unspecified GSS failure.  Minor code may provide more information
      pam_sss_gss: GSSAPI: No credentials cache found
      pam_sss_gss: Switching euid from 1366200907 to 0
      pam_sss_gss: System error [5]: Input/output error