【linux】非root用户ssh免密登录失败,Authentication refused: bad ownership or modes for directory /home/XXX

在使用非root用户,配置集群免密登录时,发现配置完了免密登录仍然需要输入密码。
查看了系统安全日志后,发现报错。

# 查看系统安全日志命令
sudo cat /var/log/secure | grep sshd

# 看时间范围内的错误的日志信息
Sep  1 17:25:53 node001 sshd[47211]: Authentication refused: bad ownership or modes for directory /home/dawson

0 首先先要配置好免密登录,即最少满足以下条件

  1. 当前服务器的当前用户的家目录下有 .ssh 文件,且 .ssh 文件中包含 id_rsa id_rsa.pub known_hosts 三个文件。
  2. 要被免密登录的服务器的对应的用户家目录下有 .ssh
  • 5
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
这个错误是由于GitHub在2021年8月13日移除了对码身份验证的支持所导致的。现在推荐使用个人访问令牌(Personal Access Token)进行身份验证。你可以在GitHub的文档中找到关于使用HTTPS URL进行克隆的更多信息,链接为https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls。在克隆时,你需要使用个人访问令牌来进行身份验证,而不是码。你可以在https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/找到更多关于令牌身份验证的信息。所以,你需要生成一个个人访问令牌,并将其用作身份验证凭据来解决这个问题。 #### 引用[.reference_title] - *1* [fatal: Authentication failed for ‘https://github.com](https://blog.csdn.net/u010751974/article/details/126542823)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [fatal: Authentication failed for ‘https://github.com/xxx.git/‘](https://blog.csdn.net/Blog_Sun/article/details/120038526)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [解决报错:fatal: Authentication failed for ‘https://github.com/*/*.git/‘](https://blog.csdn.net/liuzehn/article/details/128037853)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值