今天用SecureCRT远程连接Linux(Centos 7)时,连不上,报错The remote system refused the connection.
于是就百度,首先查看sshd服务有没有启动


只有ssh-agent,于是去启动sshd
执行如下命令
cd /etc/init.d
systemctl restart sshd.service
没有成功,报错Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.

再使用这个命令journalctl -xe看错误信息,具体报错信息如下。

[root@localhost ssh]# systemctl restart sshd.service
Job for sshd.service failed because the control process exited with error code. See "systemctl status sshd.service" and "journalctl -xe" for details.
[root@localhost ssh]#  journalctl -xe
12月 05 10:45:01 localhost.localdomain sshd[11508]: Permissions 0715 for '/etc/ssh/ssh_host_rsa_key' are too open.
12月 05 10:45:01 localhost.localdomain sshd[11508]: It is required that your private key files are NOT accessible by others.
12月 05 10:45:01 localhost.localdomain sshd[11508]: This private key will be ignored.
12月 05 10:45:01 localhost.localdomain sshd[11508]: key_load_private: bad permissions
12月 05 10:45:01 localhost.localdomain sshd[11508]: Could not load host key: /etc/ssh/ssh_host_rsa_key
12月 05 10:45:01 localhost.localdomain sshd[11508]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
12月 05 10:45:01 localhost.localdomain sshd[11508]: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
12月 05 10:45:01 localhost.localdomain sshd[11508]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
12月 05 10:45:01 localhost.localdomain sshd[11508]: Permissions 0715 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
12月 05 10:45:01 localhost.localdomain sshd[11508]: It is required that your private key files are NOT accessible by others.
12月 05 10:45:01 localhost.localdomain sshd[11508]: This private key will be ignored.
12月 05 10:45:01 localhost.localdomain sshd[11508]: key_load_private: bad permissions
12月 05 10:45:01 localhost.localdomain sshd[11508]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
12月 05 10:45:01 localhost.localdomain systemd[1]: sshd.service: main process exited, code=exited, status=1/FAILURE
12月 05 10:45:01 localhost.localdomain sshd[11508]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
12月 05 10:45:01 localhost.localdomain sshd[11508]: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
12月 05 10:45:01 localhost.localdomain sshd[11508]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
12月 05 10:45:01 localhost.localdomain sshd[11508]: Permissions 0715 for '/etc/ssh/ssh_host_ed25519_key' are too open.
12月 05 10:45:01 localhost.localdomain sshd[11508]: It is required that your private key files are NOT accessible by others.
12月 05 10:45:01 localhost.localdomain sshd[11508]: This private key will be ignored.
12月 05 10:45:01 localhost.localdomain sshd[11508]: key_load_private: bad permissions
12月 05 10:45:01 localhost.localdomain sshd[11508]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
12月 05 10:45:01 localhost.localdomain sshd[11508]: sshd: no hostkeys available -- exiting.
12月 05 10:45:01 localhost.localdomain systemd[1]: Failed to start OpenSSH server daemon.
-- Subject: Unit sshd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit sshd.service has failed.
-- 
-- The result is failed.
12月 05 10:45:01 localhost.localdomain systemd[1]: Unit sshd.service entered failed state.
12月 05 10:45:01 localhost.localdomain systemd[1]: sshd.service failed.
12月 05 10:45:01 localhost.localdomain polkitd[7760]: Unregistered Authentication Agent for unix-process:11502:197209 (system bus name :1.14
lines 1492-1525/1525 (END)

看到很多Permissions这个词,权限。
诸如;
Permissions 0715 for '/etc/ssh/ssh_host_rsa_key' are too open.
key_load_private: bad permissions
的错,这是一些密钥文件,也就是说没有权限访问这几个文件,可我用的root啊也没权限,奇怪了。

那么我们看看这三个文件现在的权限是什么。切到/etc/sshll查看,这三个文件的权限是755,感觉没啥问题啊。继续百度吧。


搜了好久,有篇博文说执行这个命令
chmod 600 /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key
也就是修改这个三个文件的权限为600

再执行systemctl restart sshd.service重启sshd服务
再查看是否启动,果然起来了。


再用SecureCRT连接就连上了。

太曲折了。期间还执行了sudo yum install openssh-server安装ssh服务,修改了ifcfg-eth0,centos没有这个文件只有ifcfg-ens33,不知有用没,还有查看端口的、/etc/ssh/sshd_config文件的Post是不是22等等。最后终于解决了。

SecureCRT远程连接The remote system refused the connection问题的更多相关文章

  1. SecureCRT连接Ubuntu报The remote system refused the connection.解决方案

    使用SecureCRT连接到远程Ubuntu,连接失败报The remote system refused the connection. 进入Ubuntu系统,终端中敲入以下命令: ps -ef|g ...

  2. []: secureCRT连接ubuntu问题- The remote system refused the connection

    secureCRT连接ubuntu问题- The remote system refused the connection http://jxyang.iteye.com/blog/1484915 解 ...

  3. secureCRT The remote system refused the connection.解决办法

    使用远程登录工具SecureCRT登陆ubuntu的时候遇到了这个问题: secureCRT The remote system refused the connection 这个问题的原因是是Ubu ...

  4. Ubuntu secuerCRT连接失败,The remote system refused the connection.

    新安装的ubuntu系统,securtCRT连接失败,出现下面结果,这是因为ubuntu没有安装工具. The remote system refused the connection. 解决办法: ...

  5. SecureCRT connecting VM Linux show error message: The remote system refused the connection.

    SecureCRT connecting VM Linux show error message: The remote system refused the connection.

  6. The remote system refused the connection.

    使用SecureCRT连接Ubuntu时,报错: The remote system refused the connection. 说明Ubuntu上没有安装openssh-server,使用命令: ...

  7. secureCRT The remote system refused the connection.

    转 http://blog.csdn.net/lifengxun20121019/article/details/13627757 我在实践远程登录工具SecureCRT的时候遇到了这个问题 Ubun ...

  8. secureCRT The remote system refused the connection问题解决

    问题: Ubuntu系统必须开启ssh服务后,XP或者其它的主机才干够远程登陆到Ubuntu系统. 1,安装软件包,运行sudo apt-get install openssh-server Ubun ...

  9. secure CRT the remote system refused the connection 解决办法

    1.安装ssh服务器和客户端 apt-get install openssh-server apt-get install openssh-client 2.重启ssh /etc/init.d/ssh ...

随机推荐

  1. JSON.parse() 报错和一些解决方法

    js 报错 Unexpected end of JSON input,Unexpected token u in JSON at position 0 JSON 通常用于与服务端交换数据. 在接收服务 ...

  2. 重启testjenkins的步骤

    在linux下编译caffe的过程中,发生错误,导致linux系统蹦了,没办法,重启linux系统. 之前安装在docker下的jenkins也停掉了. 先启动jenkins的步骤如下: 1.先启动d ...

  3. Scrapy爬虫及案例剖析

    由于互联网的极速发展,所有现在的信息处于大量堆积的状态,我们既要向外界获取大量数据,又要在大量数据中过滤无用的数据.针对我们有益的数据需要我们进行指定抓取,从而出现了现在的爬虫技术,通过爬虫技术我们可 ...

  4. 带着canvas去流浪系列之七 绘制水球图

    [摘要] 用原生canvasAPI实现百度echarts 示例代码托管在:http://www.github.com/dashnowords/blogs 一. 任务说明 使用原生canvasAPI绘制 ...

  5. [ch05-00] 多变量线性回归问题

    系列博客,原文在笔者所维护的github上:https://aka.ms/beginnerAI, 点击star加星不要吝啬,星越多笔者越努力. 第5章 多入单出的单层神经网络 5.0 多变量线性回归问 ...

  6. png兼容IE6的方法

    1.通过CSS滤镜使背景图的PNG对IE6进行兼容 定义一个样式,给某个div应用这个样式后,div的透明png背景图片自动透明了. <style> body{background: li ...

  7. Spring MVC上传文件原理和resolveLazily说明

    问题:使用Spring MVC上传大文件,发现从页面提交,到进入后台controller,时间很长.怀疑是文件上传完成后,才进入.由于在HTTP首部自定义了“Token”字段用于权限校验,Token的 ...

  8. iOS app反编译

    对于APP store 上的应用都是加密的了,反编译起来有难度. 对于自己用xcode 编译的ipa 或者是其他渠道下载的ipa包都可以使用反编译工具进行反编译. https://cnbin.gith ...

  9. Java修炼——反射机制

    反射机制常见的作用: 1) 动态的加载类.动态的获取类的信息(属性,方法,构造器) 2) 动态构造对象 3) 动态调用类和对象的任意方法.构造器 4) 动态调用和处理属性 5) 获取泛型信息 6) 处 ...

  10. idea结合maven小项目

    整体构造 (修改 POM 文件 )parent <?xml version="1.0" encoding="UTF-8"?> <project ...