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以下类似,但要注 ...
随机推荐
- git取消操作命令
1,移除git add . 的内容 git reset HEAD 2,移除git commit 的内容(commit_A是文件名) git rebase -i commit_A
- Javascript问题集锦
1.Date.parse()函数兼容性问题: IE Chrome Firefox Date.parse("07-17-2019") 1563292800000 15632928 ...
- LRU算法介绍和在JAVA的实现及源码分析
一.写随笔的原因:最近准备去朋友公司面试,他说让我看一下LRU算法,就此整理一下,方便以后的复习. 二.具体的内容: 1.简介: LRU是Least Recently Used的缩写,即最近最少使用. ...
- Powershell - 获取服务器启动时间
www.orangeisland.cn 使用以下命令,直接获取服务器启动时间: 通过以下脚本,批量获取服务器的启动时间: $TextPath = "C:\Users\admin\Deskto ...
- Systemctl和service、chkconfig命令的关系
systemctl命令:是一个systemd工具,主要负责控制systemd系统和服务管理器. service命令:可以启动.停止.重新启动和关闭系统服务,还可以显示所有系统服务的当前状态. ch ...
- 架构师成长之路5.5-Saltstack配置管理(状态间关系)
点击架构师成长之路 架构师成长之路5.5-Saltstack配置管理(状态间关系) 配置管理工具: Pupper:1. 采用ruby编程语言:2. 安装环境相对较复杂:3.不支持远程执行,需要FUNC ...
- 第二章 Vue快速入门-- 25 过滤器-定义格式化时间的全局过滤器
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- 更换Red Hat Enterprise Linux 7 64位的yum为centos的版本
查看redhat原有的yum包有哪些: [root@localhost ~]# rpm -qa|grep yum yum-utils-1.1.31-24.el7.noarch yum-langpack ...
- mybatis 关联查询和嵌套查询的简单示例
两个表: Customer 顾客表 create table if not exists customer( customer_id int primary key auto_increment, f ...
- JS实现表格隔行变色
用到的鼠标事件:(1)鼠标经过 onmouseover:(2)鼠标离开 onmouseout 核心思路:鼠标经过 tr 行的时候,当前行会改变背景颜色,鼠标离开的时候去掉背景颜色. 注意:第一行(th ...