由于sshd配置错误,SSH登录无法在centos上运行

8wtpewkr  于 2022-11-07  发布在  其他
关注(0)|答案(1)|浏览(164)

我试图在Centos服务器上配置SFTP。我编辑了/etc/ssh/sshd_config文件并重新启动服务。Chroot行出现错误。一段时间后,与服务器的连接中断,从那时起,再也没有人能够登录到服务器。显然,无法更正sshd配置,因为无法登录到服务器。
我有根详细信息。Plesk配置到服务器以管理域。仍然无法做很多事情。
以下是尝试ssh登录时的错误日志:

debug1: Authentication succeeded (publickey).
Authenticated to *.*.*.* ([*.*.*.*]:*).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: channel 0: free: client-session, nchannels 1
Connection to *.*.*.* closed by remote host.
Connection to *.*.*.* closed.
Transferred: sent 3412, received 2164 bytes, in 0.1 seconds
Bytes per second: sent 54190.6, received 34369.4
debug1: Exit status -1
4xrmg8kj

4xrmg8kj1#

如果您的整个SSH配置只是一团糟,您可能只想卸载它,然后重新安装它。
从root用户或使用sudo:
删除:


# chkconfig sshd off

# service sshd stop

# yum erase openssh-server

安装:


# yum –y install openssh-server openssh-clients

# systemctl start sshd

这是一个非常广泛的解决方案,如果您有更多的细节,我可能可以进一步帮助您。

相关问题