
























CephX is the authentication protocol used by Ceph to secure communication between clients and cluster daemons. Understanding how CephX works is essential for administering secure Ceph deployments and diagnosing authentication failures.
CephX is a shared-secret authentication system inspired by Kerberos. It uses symmetric cryptography and session tickets to authenticate entities (clients, OSDs, MONs, MDSs) without transmitting secrets over the network.
The key participants in CephX are:
The CephX handshake follows these steps:
client.admin)# View all existing auth keys in the cluster
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- ceph auth list
# Get details for a specific entity
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- ceph auth get client.adminEach entity in the cluster uses a keyring file to store its shared secret:
# Export a specific keyring
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
ceph auth get client.admin -o /tmp/ceph.client.admin.keyring
# Print keyring content
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
ceph auth print-key client.adminIn Rook, keyrings are stored as Kubernetes Secrets:
kubectl -n rook-ceph get secret rook-ceph-admin-keyring -o yamlEvery key has capability strings that define what it can do:
# Create a restricted client key
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
ceph auth get-or-create client.myapp \
mon 'allow r' \
osd 'allow rw pool=mypool'Common capability values:
allow r - read-only accessallow rw - read/write accessallow * - full access (use with caution)allow rw pool=<name> - scoped to a specific poolIf a client fails to authenticate, check the Monitor logs:
kubectl -n rook-ceph logs deploy/rook-ceph-mon-a | grep -i "auth\|EACCES\|no key"Test authentication directly:
kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- \
ceph --id myapp --keyring /etc/ceph/keyring healthCommon errors and fixes:
EACCES - wrong key or capability mismatchauth: error reading file - keyring file missing or wrong permissionsno key: client.X - entity does not exist in auth databaseCephX authentication uses a challenge-response mechanism where Monitors act as an authentication authority, issuing time-limited session tickets to verified clients. Keyrings store shared secrets, and capabilities define fine-grained access permissions. In Rook-managed clusters, keyrings are stored as Kubernetes Secrets and can be inspected and rotated via standard Ceph auth commands or the Rook operator.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。