Kerberos常用命令笔记

半兽人 发表于: 2016-07-26   最后更新时间: 2019-10-17 15:21:53  
{{totalSubscript}} 订阅, 9,174 游览

增加用户,带随机密码的

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
更新于 2019-10-17

查看Kerberos更多相关的文章或提一个关于Kerberos的问题,也可以与我们一起分享文章