返回到文章

采纳

编辑于

Kerberos常用命令笔记

kerberos
Kerberos
笔记

增加用户,带随机密码的

sudo /usr/sbin/kadmin.local -q 'addprinc -randkey kafka/10.211.55.5@EXAMPLE.COM'
sudo /usr/sbin/kadmin.local -q 'addprinc -randkey zookeeper/127.0.0.1@EXAMPLE.COM'

添加到密钥库

sudo /usr/sbin/kadmin.local -q "ktadd -k /var/kerberos/krb5kdc/kafka.keytab kafka/10.211.55.5@EXAMPLE.COM”
sudo /usr/sbin/kadmin.local -q "ktadd -k /var/kerberos/krb5kdc/kafka.keytab kafka/weiwei@EXAMPLE.COM’
sudo /usr/sbin/kadmin.local -q "ktadd -k /var/kerberos/krb5kdc/kafka.keytab zookeeper/10.211.55.5@EXAMPLE.COM”
sudo /usr/sbin/kadmin.local -q "ktadd -k /var/kerberos/krb5kdc/kafka.keytab zookeeper/127.0.0.1@EXAMPLE.COM”
sudo /usr/sbin/kadmin.local -q "ktadd -k /var/kerberos/krb5kdc/kafka.keytab clients@EXAMPLE.COM”

查看数据库密钥

klist -t -e -k /var/kerberos/krb5kdc/kafka.keytab

查看方式2

ktutil
rkt /var/kerberos/krb5kdc/kafka.keytab

初始化密钥

kinit -kt /var/kerberos/krb5kdc/kafka.keytab kafka/10.211.55.5@EXAMPLE.COM

启动kerberos

service krb5kdc restart
chkconfig krb5kdc on

启动kadmind

kadmind