国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

解決linux下set_loginuid failed opening loginuid報錯問題

2020-05-27 12:56:47
字體:
來源:轉載
供稿:網友

   自從使用php-syslog-ng監控日志信息后,經常發現一些過去會忽略的報錯信息,目前正逐一解決中。其中一個報錯發生在,我使用密鑰通過ssh登陸到服務器的時候,日志信息顯示:

  Nov 19 10:32:20 printserver auth 10:32:20 pam_loginuid[9691]: set_loginuid failed opening loginuid

  Nov 19 10:32:20 printserver auth 10:32:20 remote(pam_unix)[9691]: session opened for user root by (uid=0)

  Nov 19 10:32:20 printserver auth 10:32:20 sshd[9689]: Accepted publickey for root from 192.168.228.244 port

  1487 ssh2

  一、原因

  操作系統:紅旗DC Server 5.0

  分析以前的系統日志,并沒有發現類似的報錯信息,故懷疑是最近的操作導致的。

  從兩方面分析:

  1、openssh-server從4.0p1升級到4.7p1;

  2、使用密鑰登陸代替原來的密碼登陸方式。

  先嘗試用原來的密碼方式登陸,沒有報錯;再對比其他機器上原4.0p1版的狀態,使用密鑰登陸,也沒有報錯。由于我升級openssh-server的時候,使用它自帶的默認配置文件而非系統4.0p1版的配置,故覺得報錯,和配置及使用密鑰登陸都有關。

  二、解決

  經查找資料后測試,可通過修改openssh-server的配置文件解決問題。

  修改/etc/ssh/sshd_config為:

  #ChallengeResponseAuthentication yes

  ChallengeResponseAuthentication no #關閉挑戰應答方式

  UsePAM no #不使用PAM認證

  保存后,重啟sshd服務即可。

  三、說明

  上述兩個參數的說明,可從幫助文檔得到注解:

  # Set this to yes to enable PAM authentication, account processing,

  # and session processing. If this is enabled, PAM authentication will

  # be allowed through the ChallengeResponseAuthentication and

  # PasswordAuthentication. Depending on your PAM configuration,

  # PAM authentication via ChallengeResponseAuthentication may bypass

  # the setting of "PermitRootLogin without-password".

  # If you just want the PAM account and session checks to run without

  # PAM authentication, then enable this but set PasswordAuthentication

  # and ChallengeResponseAuthentication to no.

  簡單來講,就是如果打開UsePAM,則會根據ChallengeResponseAuthentication來決定是否使用挑戰應答方式(我不知道是否這樣翻譯)。而該方式是根據密碼判斷的,不能和密鑰登陸兼容,所以會出現報錯。

  不同的配置,可從日志中得到完全不同的結果:

  1、關閉ChallengeResponseAuthentication和打開UsePAM

  使用密鑰登陸:

  引用

  Nov 19 10:57:20 printserver auth 10:57:20 sshd(pam_unix)[10322]: session opened for user root by root(uid=0)

  Nov 19 10:57:20 printserver auth 10:57:20 sshd[10320]: Accepted publickey for root from 192.168.228.244 port 1595 ssh2

  2、打開ChallengeResponseAuthentication和UsePAM

  使用密鑰登陸就會報錯,而使用密碼登陸是正常的:

  Nov 19 12:23:33 printserver sshd(pam_unix)[24454]: session opened for user root by root(uid=0)

  四、其他

  在Google的時候,發現有另外一種解決方法:點擊

  就是修改/etc/pam.d/sshd,把下面這行注釋:

  session required pam_loginuid.so

  不過,我在系統中并沒有找到這行。反而,從日志可以看到,報錯是由PAM調用remote發出的,所以,我修改/etc/pam.d/remote,把這行注釋:

  引用

  session required pam_loginuid.so

  這樣,確認不會再報上面的錯誤。但登陸的時候,日志就會顯示:

  Nov 19 10:06:31 printserver sshd[9582]: Accepted publickey for root from 192.168.228.244

  port 1228 ssh2

  Nov 19 10:06:31 printserver remote(pam_unix)[9584]: session opened for user root by (uid=0)

  Nov 19 10:06:31 login -- root[9584]: ROOT LOGIN ON pts/2 FROM 192.168.228.244

  發出信息的主機從printserver改為login了,日志分類會有有錯,不利于使用咯。

  ◎至于因為核心沒有打開CONFIG_AUDIT功能引起的解決辦法

  經確認,紅旗DC Server 5.0的核心是已經打開CONFIG_AUDIT的,所以,解決方法無效。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 赤峰市| 比如县| 全南县| 台中县| 芒康县| 永康市| 四川省| 墨玉县| 肇源县| 兴和县| 东山县| 新兴县| 大英县| 宜宾市| 古丈县| 内乡县| 汝阳县| 公主岭市| 黑龙江省| 保德县| 抚宁县| 镇沅| 湟中县| 阳谷县| 汝南县| 丁青县| 互助| 金坛市| 沂南县| 邵东县| 平江县| 依安县| 平罗县| 山阴县| 龙游县| 古丈县| 浏阳市| 同德县| 芒康县| 田东县| 浦城县|