ssh免密登录方法不生效?Authentication refused: bad ownership or modes for directory
生活随笔
收集整理的這篇文章主要介紹了
ssh免密登录方法不生效?Authentication refused: bad ownership or modes for directory
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
機(jī)器A通過ssh登錄機(jī)器B,方法有兩種:
1、密碼方式
2、密鑰方式:
兩種方式同時(shí)開啟的時(shí)候,優(yōu)先使用密鑰方式。
密鑰登錄方式的配置方法是,首先在登錄機(jī)器B上創(chuàng)建文件authorized_keys(touch authorized_keys);其次正確設(shè)置文件authorized_keys的權(quán)限,一般是chmod -0600 authorized_keys,注意這里的權(quán)限設(shè)置
如果希望ssh公鑰生效需滿足至少下面3個(gè)條件: 1)? .ssh目錄的權(quán)限必須是700? 2) .ssh/authorized_keys文件權(quán)限必須是600 3) 用戶目錄權(quán)限為 755 或者 700,就是不能是77x。 登陸目標(biāo)機(jī)器,查看sshd的日志信息。日志信息目錄為,/var/log/secure 參考: https://www.bo56.com/ssh%E5%85%8D%E5%AF%86%E7%A0%81%E7%99%BB%E9%99%86%E8%AE%BE%E7%BD%AE%E6%97%B6authentication-refused-bad-ownership-or-modes%E9%94%99%E8%AF%AF%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95/轉(zhuǎn)載于:https://www.cnblogs.com/shengulong/p/6709743.html
總結(jié)
以上是生活随笔為你收集整理的ssh免密登录方法不生效?Authentication refused: bad ownership or modes for directory的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python基础-map/reduce/
- 下一篇: 【LeetCode】002 Add Tw