-2

我试图在 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
4

1 回答 1

0

如果您的整个 SSH 配置只是搞砸了,您可能只想卸载它然后重新安装它。

从 root 或使用 sudo:

擦除:

# chkconfig sshd off
# service sshd stop
# yum erase openssh-server

安装:

# yum –y install openssh-server openssh-clients
# systemctl start sshd

这是一个非常广泛的解决方案,如果您有更多详细信息,我可能会为您提供进一步的帮助。

于 2022-01-02T00:06:44.217 回答