sshd_config已修改,ssh还是无法远程问题解决
环境:vmware下的debian10.2
/etc/sshd/sshd_config 配置文件已经完成修改开启允许root账号登录配置
ssh远程返回如下信息:
[Administrator.NIHAORZ-WORK-PC] ➤ ssh root@192.168.36.135
Connection reset by 192.168.36.135 port 22
通过vmware进入虚拟机查看服务状态返回:
debian:~# systemctl status sshd
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-12-19 08:57:57 UTC; 14s ago
Docs: man:sshd(8)
man:sshd_config(5)
Process: 850 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 851 (sshd)
Tasks: 7 (limit: 9511)
Memory: 7.6M
CGroup: /system.slice/ssh.service
├─786 sshd: root@pts/0
├─788 sshd: root@notty
├─790 /usr/lib/openssh/sftp-server
├─792 -bash
├─851 /usr/sbin/sshd -D
├─856 systemctl status sshd
└─857 pager
Dec 19 08:57:57 debian systemd[1]: ssh.service: Found left-over process 848 (systemctl) in control group while starting unit. Ignoring.
Dec 19 08:57:57 debian systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Dec 19 08:57:57 debian systemd[1]: ssh.service: Found left-over process 849 (systemd-tty-ask) in control group while starting unit. Ignoring.
Dec 19 08:57:57 debian systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.
Dec 19 08:57:57 debian sshd[851]: Could not load host key: /etc/ssh/ssh_host_rsa_key
Dec 19 08:57:57 debian sshd[851]: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Dec 19 08:57:57 debian sshd[851]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Dec 19 08:57:57 debian sshd[851]: Server listening on 0.0.0.0 port 22.
Dec 19 08:57:57 debian systemd[1]: Started OpenBSD Secure Shell server.
Dec 19 08:57:57 debian sshd[851]: Server listening on :: port 22.
显示缺失ssh_host_rsa_key、ssh_host_ecdsa_key和ssh_host_ed25519_key三个文件
执行如下三条命令创建密钥文件:
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
再依次执行服务重启和服务状态查看命令,确认服务启动正常则尝试再次ssh远程
systemctl restart sshd
systemctl status sshd
sshd_config已修改,ssh还是无法远程问题解决的更多相关文章
- CentOS 6.0修改ssh远程连接端口
转自:系统运维 » CentOS 6.0修改ssh远程连接端口 实现目的:把ssh默认远程连接端口修改为2222 方法如下: 1.编辑防火墙配置:vi /etc/sysconfig/iptables ...
- Linux修改SSH端口和禁止Root远程登陆
Linux修改ssh端口22 vi /etc/ssh/ssh_config vi /etc/ssh/sshd_config 然后修改为port 8888 以root身份service sshd res ...
- linux修改ssh端口 以及禁止root远程登录 (实验机 CentOs)
把ssh默认远程连接端口修改为3333 1.编辑防火墙配置: vi /etc/sysconfig/iptables 防火墙新增端口3333,方法如下: -A INPUT -m state --stat ...
- 【转】Linux修改SSH端口和禁止Root远程登陆
Linux修改ssh端口22 vi /etc/ssh/ssh_config vi /etc/ssh/sshd_config 然后修改为port 8888 以root身份service sshd res ...
- 修改ssh远程默认端口
修改ssh远程默认端口 Linuxssh端口修改 1. 修改ssh配置文件 [root@distzabbix ~]# vim /etc/ssh/sshd_config 找到第17行附近#Port 22 ...
- Linux—修改ssh远程登录信息
修改ssh远程登录端口 1.修改ssh服务的配置文件:/etc/ssh/sshd_config ,将 Port 22 改为 Port 3120 保存退出. [root@localhost ~]# vi ...
- CentOS7修改SSH远程连接端口
CentOS7修改SSH远程连接端口
- 如何修改Linux系统的 /etc/ssh/sshd_config 文件 "/etc/ssh/sshd_config" E212: Can't open file for writin
第一步:我们使用命令行vim /etc/ssh/sshd_config 执行修改,强制保持 :wq! 系统不让我们修改这个文件 "/etc/ssh/sshd_config" ...
- RHEL7 修改SSH默认端口及修改SELinux运行状态
RHEL7安装后,默认开启SSH服务以便远程配置,但默认端口22并不安全,一般不建议使用默认端口,那就修改SSH默认端口.在sshd_config里面的修改RHEL7.0上修改和7.0以下类似,但要注 ...
随机推荐
- ajax异步刷新请求数据
AJAX是与服务器交换数据的艺术,它在不重载全部页面的情况下,实现了对部分网页的更新.AJAX = 异步 JavaScript 和 XML(Asynchronous JavaScript and XM ...
- js中自然日的计算
需求:前端取后端返回的时间与当前时间进行比较展示,展示规则: 1.返回的时间跟当前时间同年同月同日 显示 今天 2.返回的时间与当前时间相差在7天以内 显示 某天前 3.返回的时间与当前时间相差大于7 ...
- Spring整合Hessian访问远程服务
声明:该文章转载自Spring整合Hessian访问远程服务,本人搬过来只是为了记录下学习Hessian的过程,忘此博主理解,在此感谢,等本人有能力了再学一些原创的东东,本人实践了下,hessianS ...
- linux上如何安装postgresql
安装对应的postgresql的yum源 rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64 ...
- 2019.9.20使用kali中的metasploi获取windows 的权限
1 kali 基于debin的数字取证系统,上面集成了很多渗透测试工具,其前身是bt5r3(bractrack) 其中Metasploit是一个综合利用工具,极大提高攻击者渗透效率,使用ruby开发的 ...
- postgresql 锁表查询语句
1 查找锁表的pid select pid from pg_locks l join pg_class t on l.relation = t.oid where t.relkind = 'r' an ...
- nginx理论基础
- mysql 主从 Last_IO_Errno错误代码说明
Last_IO_Errno错误代码说明: 1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件 ...
- ES修改最大分页数
curl -XPUT http://localhost:9200/my_index/_settings?preserve_existing=true -H 'Content-Type: applica ...
- nginx第一天
nginx 介绍 常见的webserver(排行https://news.netcraft.com/archives/2018/) 老牌:httpd(早期叫Apache),开源,市场份额最高 微软:i ...