CephX认证机制

列出指定用户信息

ceph auth get osd.10
ceph auth get client.admin

 列出用户

ceph auth list

将用户信息输出到123.key

ceph auth list -o 123.key

添加认证key(对mon有读权限,对mypool的存储池有读写执行)

ceph auth add client.tom mon 'allow r' osd 'allow rwx pool=mypool'

验证上面创建的key

ceph auth get client.tom

get-or-create直接查用户,如果存在直接显示结果,如果不存在会创建

ceph auth get-or-create client.jack mon 'allow r' osd 'allow rwx pool=mypool'

get-or-create-key对于只需要密钥的客户端(例如libvirt)

ceph auth get-or-create-key client,jack mon 'allow r' osd 'allow rwx pool=mypool'

获取单个指定用户的key信息

ceph auth print-key client.jack

修改用户权限

ceph auth caps client.user1 mon 'allow r' osd 'allow r pool=myrbd1'

删除用户

ceph auth del client.user1

 

通过密钥环文件备份与恢复用户

ceph auth get-or-create client.user1 mon 'allow r' osd 'allow * pool=mypool' #创建用户
ceph get client.user1 #查看用户
ceph-authtool --create-keying ceph.client.user1.keyring #创建keyring文件
ceph auth get client.user1 -o ceph.client.user1.keyring #导出keyring至指定文件
cat ceph.client.user1.keyring #验证指定用户的keyring文件
ceph auth del client.user1 #删除用户
ceph auth import -i ceph.client.user1.keyring #从备份文件导入用户
ceph auth get client.user1 #查看下用户

 

密钥环文件多用户,将多用户导出至密钥环

ceph-authtool --create-keyring ceph.client.user.keyring # 创建keyring文件
ceph-authtool ./ceph.client.user.keyring --import-keyring ./ceph.client.admin.keyring #把指定的admin用户的keyring文件内容导入道user用户的keyring文件
ceph-authtool -l ./ceph.client.user.keyring #验证keyring文件
ceph-authtool ./ceph.client.user.keyring --import-keyring ./ceph.client.user1.keyring #把user1的导入进来
ceph-authtool -l ./ceph.client.user.keyring #在查看下就是两个了

 

posted @ 2022-09-08 15:41  Maniana  阅读(75)  评论(0编辑  收藏  举报