ssh连接报Connection closed by foreign host.

ゞ 浴缸里的玫瑰 2022-05-28 08:43 350阅读 0赞

今天连接linux时居然连不上,报错信息是:

[plain] view plain copy

  1. Connecting to 192.168.16.133:22…
  2. Connection established.
  3. To escape to local shell, press ‘Ctrl+Alt+]‘.
  4. Connection closed by foreign host.
  5. Disconnected from remote host(hadoop3) at 10:56:11.
  6. Type `help’ to learn how to use Xshell prompt.

查了一下终于找到了解决办法,只需要一些命令就可以了:

[plain] view plain copy

  1. cd /etc/ssh
  2. sudo chmod 644 ./*
  3. sudo chmod 600 ssh_host_dsa_key
  4. sudo chmod 600 ssh_host_rsa_key
  5. sudo chmod 755 .
  6. /etc/init.d/sshd restart

完成后在重新连接就行了。

转载地址

发表评论

表情:
评论列表 (有 0 条评论,350人围观)

还没有评论,来说两句吧...

相关阅读