Kerberos常見報錯匯總
作者:尹正傑
版權聲明:原創作品,謝絕轉載!否則將追究法律責任。
一.kdb5_util: Password mismatch while reading master key from keyboard
1>.錯誤復現
2>.錯誤原因分析
在初始化Kerberos數據庫時需要輸入密碼,2次密碼輸入不一致就會導致該錯誤。
3>.解決方案
重新執行"kdb5_util -r YINZHENGJIE.COM create -s"指令,輸入2次相同的密碼即可。
二.kdb5_util: Required parameters in kdc.conf missing while initializing kerberos admin interface
1>.錯誤復現
2>.錯誤原因分析
一般情況下出現在配置文件(kdc.conf)中的"supported_enctypes"的某個加密類型不可用。
3>.解決方案
下面我針對"supported_enctypes"做了修改,大家可以做個對比。使用修改后的參數問題得到解決,之所以貼出來修改后的是為了提供一個參考。
修改前: supported_enctypes = aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal des-hmac-sha1:normal des-cbc-md5:normal des-cbc-crc:normal 修改后: supported_enctypes = aes256-cts:normal aes128-cts:normal des3-hmac-sha1:normal arcfour-hmac:normal
三.kadmin.local: Required parameters in kdc.conf missing while initializing kadmin.local interface
1>.錯誤復現
2>.錯誤原因分析
一般情況下出現在配置文件(kdc.conf)中的"supported_enctypes"的某個加密類型不可用。
3>.解決方案
參考案例二。
四.kadmin.local: Cannot open DB2 database '/yinzhengjie/softwares/kerberos/data/principal': No such file or directory while initializing kadmin.local interface
1>.錯誤復現
2>.錯誤原因分析
報錯很明顯提示咱們找不到DB數據庫相關信息。一般情況下是我們在安裝Kerberos時沒有做數據庫初始化操作。
3>.解決方案
注意觀察KDC配置文件("kdc.conf")的"database_name"屬性。當我們對Kerberos數據庫做了初始化操作時,對生成對應的文件喲~ 初始化Kerberos數據庫的命令如下: kdb5_util -r YINZHENGJIE.COM create -s
五.(Error): WARNING! Cannot find dictionary file /yinzhengjie/softwares/kerberos/data/dict/words, continuing without one.
1>.錯誤復現
2>.錯誤原因分析
根據日志的報錯信息可判斷,是因為沒有對應的文件(由kdc.conf配置文件的"dict_file"標簽指定路徑)導致的報錯信息,但這並不影響您啟動程序。
3>.解決方案
解決方法很簡單,創建響應的文件即可,操作案例如下所示: [root@kdc.yinzhengjie.com ~]# mkdir -pv /yinzhengjie/softwares/kerberos/data/dict mkdir: created directory ‘/yinzhengjie/softwares/kerberos/data/dict’ [root@kdc.yinzhengjie.com ~]# [root@kdc.yinzhengjie.com ~]# vim /yinzhengjie/softwares/kerberos/data/dict/words [root@kdc.yinzhengjie.com ~]# [root@kdc.yinzhengjie.com ~]# cat /yinzhengjie/softwares/kerberos/data/dict/words 123456 [root@kdc.yinzhengjie.com ~]#
六.Couldn't open log file ${KERBEROS_HOME}/logs/kadmind.log: No such file or directory
1>.錯誤復現
2>.錯誤原因分析
一般是krb5.conf配置文件中的[logging]的"admin_server"標簽對應的路徑並不存在,建議寫絕對路徑,若寫自定義的Linux變量可能不會被識別喲!
3>.解決方案
指定絕對路徑即可,下面是我修改krb5.conf配置文件的過程。 修改前: [logging] default = FILE:${KERBEROS_HOME}/logs/krb5libs.log kdc = FILE:${KERBEROS_HOME}/logs/krb5kdc.log admin_server = FILE:${KERBEROS_HOME}/logs/kadmind.log 修改后: [logging] default = FILE:/yinzhengjie/softwares/kerberos/logs/krb5libs.log kdc = FILE:/yinzhengjie/softwares/kerberos/logs/krb5kdc.log admin_server = FILE:/yinzhengjie/softwares/kerberos/logs/kadmind.log
七.kdb5_util: Cannot open DB2 database '/yinzhengjie/softwares/kerberos/data/yinzhengjie-principal': File exists while creating database '/yinzhengjie/softwares/kerberos/data/yinzhengjie-principal'
1>.錯誤復現
2>.錯誤原因分析
數據庫已經存在啦,因此會出現上圖所示的錯誤。
溫馨提示:
Kerberos的數據庫初始化一次即可,無需初始化第二次,若你的管理員密碼忘記了那就得重新初始化了,但這意味之前的數據必須全部刪除。生產環境中要慎重啊!
3>.解決方案
方案一:
刪除已存在的數據庫文件,重新執行初始化操作,這意味着之前的所有數據全部丟失!生產環境要慎重喲,盡量避免不要這樣干!
方案二:
放棄重新初始化操作,因為已經存在數據庫文件了,直接使用現有數據庫即可,除非你不得不重新初始化操作(比如忘記了KDC管理員的密碼)!
溫馨提示:
初始化的數據庫密碼一定要記住哈,這樣可以給你減少不必要的麻煩!
八.kadmind: Cannot allocate memory while initializing network, aborting
1>.錯誤復現
2>.錯誤原因分析
3>.解決方案
九.官方故障排除案例
博主推薦閱讀: https://web.mit.edu/kerberos/krb5-latest/doc/admin/troubleshoot.html