1.下載jce并解壓
jce下載地址:http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html
創(chuàng)新互聯(lián)主營(yíng)蟠龍網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,app軟件開(kāi)發(fā),蟠龍h5小程序開(kāi)發(fā)搭建,蟠龍網(wǎng)站營(yíng)銷(xiāo)推廣歡迎蟠龍等地區(qū)企業(yè)咨詢(xún)
[root@manager ~]# ls
jce_policy-8.zip
[root@manager ~]# unzip -o -j -q jce_policy-8.zip -d /usr/local/jdk/jre/lib/security/
2.安裝krb5
[root@manager ~]# yum install -y krb5-libs krb5-workstation
3.修改配置文件
[root@manager ~]# cat /etc/krb5.conf
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
DNS_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
default_realm = KRB.COM #修改為認(rèn)證域
default_ccache_name = KEYRING:persistent:%{uid}
[realms]
KRB.COM = {
kdc = 192.168.10.131 #KDC的地址
admin_server = 192.168.10.131 #kadmin服務(wù)地址
}
[domain_realm]
#以上需要在服務(wù)端和客戶(hù)端都配置,可以在服務(wù)端配置好以后使用scp拷貝。
4.在服務(wù)端安裝krb5-server
[root@manager ~]# yum install -y krb5-server
5.修改服務(wù)端的配置文件
[root@manager ~]# cat /var/kerberos/krb5kdc/kdc.conf
[kdcdefaults]
kdc_ports = 88
kdc_tcp_ports = 88
[realms]
KRB.COM = {
#master_key_type = aes256-cts
acl_file = /var/kerberos/krb5kdc/kadm5.acl
dict_file = /usr/share/dict/words
admin_keytab = /var/kerberos/krb5kdc/kadm5.keytab
supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal camellia256-cts:normal camellia128-cts:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal
}
1.創(chuàng)建kerberos數(shù)據(jù)庫(kù)
[root@manager ~]# kdb5_util create -s -r KRB.COM
Loading random data
Initializing database '/var/kerberos/krb5kdc/principal' for realm 'KRB.COM',
master key name 'K/M@KRB.COM'
You will be prompted for the database Master Password.
It is important that you NOT FORGET this password.
Enter KDC database master key:
Re-enter KDC database master key to verify:
2.創(chuàng)建管理員
[root@manager ~]# kadmin.local -q "addprinc admin/admin"
Authenticating as principal root/admin@KRB.COM with password.
WARNING: no policy specified for admin/admin@KRB.COM; defaulting to no policy
Enter password for principal "admin/admin@KRB.COM":
Re-enter password for principal "admin/admin@KRB.COM":
Principal "admin/admin@KRB.COM" created.
3.給管理員賬戶(hù)添加acl權(quán)限
[root@manager ~]# cat /var/kerberos/krb5kdc/kadm5.acl
*/admin@KRB.COM *
4.啟動(dòng)服務(wù)和設(shè)置開(kāi)機(jī)自啟
[root@manager ~]# systemctl start krb5kdc
[root@manager ~]# systemctl start kadmin
[root@manager ~]# systemctl enable krb5kdc
[root@manager ~]# systemctl enable kadmin
5.在客戶(hù)端測(cè)試連接
[root@vm1 ~]# kadmin -p admin/admin
Authenticating as principal admin/admin with password.
Password for admin/admin@KRB.COM:
kadmin: listprincs
K/M@KRB.COM
admin/admin@KRB.COM
kadmin/admin@KRB.COM
kadmin/changepw@KRB.COM
kadmin/manager@KRB.COM
kiprop/manager@KRB.COM
krbtgt/KRB.COM@KRB.COM
kadmin: quit
6.重新啟動(dòng)ambari-server
[root@manager ~]# ambari-server restart
1.開(kāi)啟Kerberos
2.選擇MIT
3.輸入KDC和Kadmin相關(guān)信息
4.安裝和測(cè)試
5.配置文件設(shè)置
6.等待停止其他服務(wù)
7.添加完成
8.等待開(kāi)啟服務(wù)
9.完成