![Kerberos화된 NFS 공유를 마운트할 때 "자격 증명 캐시 없음" 오류가 발생하는 이유는 무엇입니까?](https://rvso.com/image/89157/Kerberos%ED%99%94%EB%90%9C%20NFS%20%EA%B3%B5%EC%9C%A0%EB%A5%BC%20%EB%A7%88%EC%9A%B4%ED%8A%B8%ED%95%A0%20%EB%95%8C%20%22%EC%9E%90%EA%B2%A9%20%EC%A6%9D%EB%AA%85%20%EC%BA%90%EC%8B%9C%20%EC%97%86%EC%9D%8C%22%20%EC%98%A4%EB%A5%98%EA%B0%80%20%EB%B0%9C%EC%83%9D%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
로컬 네트워크에 nfsclient(CentOS 7)와 nfsserver(CentOS 6)라는 두 개의 시스템이 있습니다. 이러한 이름은 해당 IP 주소로 올바르게 확인되며 Kerberos는 이들 사이에서 작동합니다(nfsserver는 KDC입니다). nfsserver에 Kerberized NFSv4 공유를 내보냈습니다. 내 /etc/exports는 다음과 같습니다:
/export *(rw,sync,fsid=0,no_subtree_check,sec=krb5p)
/export/home *(rw,sync,no_subtree_check,no_root_squash,sec=krb5p)
nfsclient에서 다음 내보내기를 볼 수 있습니다.
[root@nfsclient ~]# showmount -e nfsserver
Export list for nfsserver:
/export/home *
/export *
/etc/exports에서 sec=krb5p 옵션을 제거하면 다음을 사용하여 nfsclient에서 공유를 마운트할 수 있습니다.
[root@nfsclient ~]# mount -t nfs4 nfsserver:/ /mnt/nfs
그러나 NFS가 Kerberos화되면 상황이 잘 진행되지 않습니다.
[root@nfsclient ~]# mount -t nfs4 -o sec=krb5p nfsserver:/ /mnt/nfs
mount.nfs4: access denied by server while mounting nfsserver:/
이는 /var/log/messages에 일련의 반복되는 오류 메시지와 함께 표시됩니다.
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
Jun 22 19:55:02 oxo gssproxy: gssproxy[769]: (OID: { 1 2 840 113554 1 2 2 }) Unspecified GSS failure. Minor code may provide more information, No credentials cache found
서버의 로그에는 아무 것도 표시되지 않습니다. 클라이언트에서 klist를 실행하면 루트에 /tmp/krb5cc_0에 자격 증명 캐시가 있음이 표시되므로 gss-proxy에 문제가 있다고 생각하게 됩니다.
/etc/gssproxy/gssproxy.conf:
[gssproxy]
[service/HTTP]
mechs = krb5
cred_store = keytab:/etc/gssproxy/http.keytab
cred_store = ccache:/var/lib/gssproxy/clients/krb5cc_%U
euid = 48
[service/nfs-server]
mechs = krb5
socket = /run/gssproxy.sock
cred_store = keytab:/etc/krb5.keytab
trusted = yes
kernel_nfsd = yes
euid = 0
[service/nfs-client]
mechs = krb5
cred_store = keytab:/etc/krb5.keytab
cred_store = ccache:FILE:/var/lib/gssproxy/clients/krb5cc_%U
cred_store = client_keytab:/var/lib/gssproxy/clients/%U.keytab
cred_usage = initiate
allow_any_uid = yes
trusted = yes
euid = 0
따라서 gss-proxy는 /var/lib/gssproxy/clients에서 자격 증명 캐시를 찾아야 합니다. 또한 /etc/krb5.keytab(nfs/nfsclient 및 host/nfsclient 주체에 대한 키가 있음)에서 키를 가져옵니다. 그러나 /var/lib/gssproxy/clients는 nfsclient에서 항상 비어 있는 것 같습니다.
여기서 뭔가 빠졌나요? 이 공유를 마운트하는 데 정확히 어떤 문제가 발생하는지 알 수 없습니다.
답변1
캐시 경로를 정의할 때 기본 파일 구성에 문제가 있습니다. 다음에서 클라이언트의 구성을 사용해 보십시오 /etc/gssproxy/gssproxy.conf
.
[service/nfs-client]
mechs = krb5
cred_store = keytab:/etc/krb5.keytab
cred_store = ccache:FILE:/tmp/krb5cc_%U
cred_usage = initiate
allow_any_uid = yes
trusted = yes
euid = 0
debug = true
답변2
클라이언트가 도메인에 가입되어 있는지 확인하세요.
ipa-client-install --force-join
그럼 티켓이 있는지 확인하세요
kinit admin
그런 다음 krb5.keytab을 다시 확인하세요.
restorecon -v /etc/krb5.keytab
클라이언트가 키탭에 있는지 확인하세요
kinit -k
host/ < client > . < domain > @REALM
그런 다음 다음을 사용하여 마운트할 수 있어야 합니다.sec=krb5p