ssh無密碼登入認證失敗
在ssh做無密碼的時候出現每次都輸入密碼的問題:
此時百度,發現可以檢視日誌檔案vi /var/log/secure,
發現裡面的如下錯誤:
Apr 6 10:06:49 gslave2 sshd[1770]: Received signal 15; terminating.
Apr 6 10:06:49 gslave2 sshd[12663]: Server listening on 0.0.0.0 port 22.
Apr 6 10:06:49 gslave2 sshd[12663]: Server listening on :: port 22.
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:01 gslave2 sshd[12675]: Connection closed by 192.168.1.251
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:24 gslave2 sshd[12678]: Connection closed by 192.168.1.251
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:51 gslave2 sshd[12754]: Accepted password for root from 192.168.1.251 port 33515 ssh2
Apr 6 10:14:51 gslave2 sshd[12754]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 6 10:14:51 gslave2 sshd[12754]: Received disconnect from 192.168.1.251: 11: disconnected by user
Apr 6 10:14:51 gslave2 sshd[12754]: pam_unix(sshd:session): session closed for user root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:56 gslave2 sshd[12771]: Accepted password for root from 192.168.1.251 port 33516 ssh2
Apr 6 10:14:56 gslave2 sshd[12771]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 6 10:14:56 gslave2 sshd[12771]: Received disconnect from 192.168.1.251: 11: disconnected by user
Apr 6 10:14:56 gslave2 sshd[12771]: pam_unix(sshd:session): session closed for user root
發現root使用者的/root目錄應該是550許可權,否則會引起很多問題,這個問題同樣是由於這個原因
原來在之前修改過/root目錄的許可權
最終,執行chmod 550 root後解決
此時百度,發現可以檢視日誌檔案vi /var/log/secure,
發現裡面的如下錯誤:
Apr 6 10:06:49 gslave2 sshd[1770]: Received signal 15; terminating.
Apr 6 10:06:49 gslave2 sshd[12663]: Server listening on 0.0.0.0 port 22.
Apr 6 10:06:49 gslave2 sshd[12663]: Server listening on :: port 22.
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:00 gslave2 sshd[12673]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:01 gslave2 sshd[12675]: Connection closed by 192.168.1.251
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:09 gslave2 sshd[12676]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:07:24 gslave2 sshd[12678]: Connection closed by 192.168.1.251
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:47 gslave2 sshd[12754]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:51 gslave2 sshd[12754]: Accepted password for root from 192.168.1.251 port 33515 ssh2
Apr 6 10:14:51 gslave2 sshd[12754]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 6 10:14:51 gslave2 sshd[12754]: Received disconnect from 192.168.1.251: 11: disconnected by user
Apr 6 10:14:51 gslave2 sshd[12754]: pam_unix(sshd:session): session closed for user root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:53 gslave2 sshd[12771]: Authentication refused: bad ownership or modes for directory /root
Apr 6 10:14:56 gslave2 sshd[12771]: Accepted password for root from 192.168.1.251 port 33516 ssh2
Apr 6 10:14:56 gslave2 sshd[12771]: pam_unix(sshd:session): session opened for user root by (uid=0)
Apr 6 10:14:56 gslave2 sshd[12771]: Received disconnect from 192.168.1.251: 11: disconnected by user
Apr 6 10:14:56 gslave2 sshd[12771]: pam_unix(sshd:session): session closed for user root
發現root使用者的/root目錄應該是550許可權,否則會引起很多問題,這個問題同樣是由於這個原因
原來在之前修改過/root目錄的許可權
最終,執行chmod 550 root後解決
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7490392/viewspace-2075957/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SSH認證免密碼登入密碼
- ssh免密碼登入失敗解決密碼
- 普通使用者ssh無密碼登陸失敗密碼
- Linux SSH無密碼登入Linux密碼
- Redis使用認證密碼登入Redis密碼
- SSH無需密碼金鑰登入密碼
- 如何實現 SSH 無密碼登入密碼
- 微軟賬戶將支援無密碼身份認證登入微軟密碼
- SSH無密碼登入到指定機器密碼
- SSH免密碼登入密碼
- 配置ssh-agent免密碼認證入門教程密碼
- ssh免認證配置後還是提示輸入密碼密碼
- Centos7密碼登入失敗鎖定設定CentOS密碼
- Mac 下 SSH 免密碼登入Mac密碼
- ssh公鑰免密碼登入密碼
- 如何設定 Ubuntu 14.04 的 SSH 無密碼登入Ubuntu密碼
- SpringBoot 整合 Shiro 密碼登入與郵件驗證碼登入(多 Realm 認證)Spring Boot密碼
- 【爛KDE】Linux登入時使用者密碼正確,卻登入失敗Linux密碼
- ssh-copy-id登陸無需重複輸入密碼密碼
- [Linux] SSH配置了免密碼登入,登入時還要輸入密碼Linux密碼
- SSH 遠端登入「記住密碼」密碼
- [RHEL7] ssh免密碼登入密碼
- 配置雙機ssh免密碼登入密碼
- centos ssh免密碼秘鑰登入CentOS密碼
- linux A機器ssh登入B機器無需輸入密碼Linux密碼
- linux 設定ssh無密碼登陸Linux密碼
- gitment 登入失敗Git
- linux系統重灌導致免密碼key登入失敗Linux密碼
- [SSH服務]——一個SSH無密碼登陸實驗密碼
- SSH 登入失敗:Host key verification failed 的處理方法AI
- centos配置ssh免密碼登入後,仍提示輸入密碼CentOS密碼
- GitHub不再支援密碼驗證解決方案:SSH免密與Token登入配置Github密碼
- ssh免密登入原理
- 無密碼身份認證,跟密碼說再見!密碼
- SSL認證失敗,製作證書
- Linux下的ssh認證,不用密碼登陸另一臺機器(轉)Linux密碼
- linux ssh公鑰免密碼登入Linux密碼
- [轉] ssh免密碼登入伺服器密碼伺服器