赞
踩
# kadmin admin/admin@CCTEST.DEV
kadminl: addprinc -randkey cctest@CCTEST.DEV //新建cctest用户
kadmin: xst -k cctest-unmerged.keytab cctest@CCTEST.DEV //生成cctest的keytab文件
kadmin: addprinc aatest@CCTEST.DEV
WARNING: no policy specified for aatest@CCTEST.DEV; defaulting to no policy
Enter password for principal "aatest@CCTEST.DEV":
Re-enter password for principal "aatest@CCTEST.DEV":
Principal "aatest@CCTEST.DEV" created.
kadmin: listprincs
aatest@CCTEST.DEV
bbtest@CCTEST.DEV
cctest@CCTEST.DEV
# ktutil
Ktutil:rkt aatest-unmerged.keytab //添加keytab文件到列表
Ktutil:wkt aatest.keytab //合并列表生成keytab文件# klist -kt cctest.keytab
Keytab name: FILE:cctest.keytab
KVNO Timestamp Principal
---- ------------------- ------------------------------------------------------
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV
4 04/28/2019 11:27:15 aatest@CCTEST.DEV注:keytab文件会生成在当前用户的home目录下
用hbase的超级用户
#kinit -kt /etc/security/keytabs/hbase.headless.keytab hbase-cchdp@CCTEST.DEV
#hbase shell
hbase(main):003:0> grant 'aatest','RWXCA' //给用户赋权 R W X C A
Took 0.2068 seconds
#kinit -kt aatest.keytab aatest@CCTEST.DEV
hbase(main):005:0> whoami
aatest@CCTEST.DEV (auth:KERBEROS)
Took 0.0096 seconds
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。