ssh无法登录Centos9解决方法

环境:Centos Stream release 9

情况:通过ssh方式,不管本地登录localhost还是远程登录,均失败。

 

尝试关闭firewalld和selinux,也不起作用。经搜索和尝试,需要修改/etc/ssh/sshd_config的PermitRootLogin的参数为yes。

这个和之前一篇root用户ssh登录Fedora报错的情况一致。

root密码输入正确,但是SSH登陆不了Fedora系统,报Password Authentication Failed_szuwangjl的博客-CSDN博客背景:Fedora 32 ,刚装好系统,控制台可以正常登录,但是通过SSH软件,即使root密码正确也是没法登录1、通过ssh软件登录报认证失败,但密码肯定没问题2、关掉防火墙,关掉selinux,重启服务器,无效systemctl stop firewalldsystemctl disable firewalldvim /etc/selinux/config ...SELINUX=disabled...3、通过另一台机器ssh -vvvv root@192.168.106.140查https://blog.csdn.net/szuwangjl/article/details/108066581#comments_23482759

TIPS:

1、使用SecureCRT v7.1.0 ssh远程Centos9服务器时,提示如下:

查看SecureCRT的SSH2配置,可以看到v7.1.0版本支持的Key exchange比较少,无法支持服务器所需要的如: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

所以此时需要使用更高级版本的SecureCRT或者其他的较新版本SSH工具,且建议把所有支持的方法都勾上。

2、Centos Stream 8、9的阿里云yum源:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all && yum makecache

参考文档:

https://www.server-world.info/en/note?os=CentOS_Stream_9&p=ssh&f=1

https://debugah.com/solved-linux-securecrt-login-ubuntu20-04-error-no-compatible-key-exchange-method-the-server-supports-these-methods-24422/

https://forums.vandyke.com/showthread.php?p=44102

SecureCRT SSH 失败 Key exchange failed 解决方法_许之恒的博客-CSDN博客_key exchange failed.

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值