消失的sshd
上午一直登录在一台远程Linux服务器上,想拿一份最新的数据库数据来,于是用 mysqldump 导出并打包成 tar.gz;在本地的一台Linux服务器上执行 sftp,诡异的事情发生了。
[root@liunx0918 shtools]# sftp xxx.xxx.xxx.xxx
Connecting to xxx.xxx.xxx.xxx...
ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused
Couldn't read packet: Connection reset by peer
[root@liunx0918 shtools]#
也就是说,这台服务器并没有启动 sshd 服务,这怎么可能呢,我不是还 ssh 在上面吗?
赶快上去看一下(因为一直登录在上面,还是可以操作的),发现少了 /usr/sbin/sshd 进程。
[root@www mysql]$ ps -ef|grep sshd
root 1971 1 0 10:08 ? 00:00:00 sshd: root@pts/0
root 8962 1973 0 15:05 pts/0 00:00:00 grep sshd
[root@www mysql]$
正常的系统是这样的:
[root@www mysql]$ ps -ef|grep sshd
root 1971 1 0 10:08 ? 00:00:00 sshd: root@pts/0
root 4862 1 0 11:46 ? 00:00:00 /usr/sbin/sshd
root 7207 4862 0 11:58 ? 00:00:00 sshd: root@pts/1
root 8962 1973 0 15:05 pts/0 00:00:00 grep sshd
[root@www mysql]$
当时的第一想法是,赶快把 sshd 启动起来。紧张啊
[root@www mysql]$ service sshd start
sshd: 未被识别的服务
[root@www mysql]$
在 /etc/init.d/ 下没有找到 sshd 脚本
[root@www mysql]$ ls /etc/init.d/sshd
ls: /etc/init.d/sshd: 没有那个文件或目录
[root@www mysql]$
发现 openssh-server 包不翼而飞
[root@www mysql]$ rpm -qa | grep ssh
openssh-clients-4.3p2-82.el5
openssh-4.3p2-82.el5
[root@www mysql]$
正常的系统肯定有,不然怎么 ssh 登录。
[root@liunx0918 backup]# rpm -qa | grep ssh
openssh-4.3p2-36.el5
openssh-clients-4.3p2-36.el5
openssh-server-4.3p2-36.el5
[root@liunx0918 backup]#
幸好,还有一个终端连在上面,赶快安装一下:
[root@www mysql]$ yum install -y openssh-server
然后重启 sshd 服务
[root@www mysql]$ service sshd start
这样终于可以从远程登录和下载文件了。松了一口气
关键的问题是:这个 sshd 为什么会不见了呢???黑客?!
在 .bash_history 文件中找到了这样的信息
yum remove tcp_wrappers
yum remove tcp_wrappers.i386 0:7.6-40.7.el5
在 /var/log/yum.log 中找到了如下信息
Jun 11 10:24:43 Erased: openssh-server
Jun 11 10:24:43 Erased: tcp_wrappers
Jun 11 11:46:05 Installed: tcp_wrappers-7.6-40.7.el5.i386
Jun 11 11:46:05 Installed: openssh-server-4.3p2-82.el5.i386
后面两条是我操作的,前面两条不是我操作的,而是别人真的把openssh-server给删了
。
后面问了一下,原来是云主机提供方帮助我们解决“无法远程访问某个服务”的问题,上去做了一些操作,没想到他会干出这样的事情来
。
不过还好,(1)发现得及时;(2)并非黑客所为;
可见:服务器的登录权限管控一定要做好,不然都不知道怎么死的。
分享到:
相关推荐
SSH服务端 Apache SSHD
基于java的开发源码-SSH服务端 Apache SSHD.zip 基于java的开发源码-SSH服务端 Apache SSHD.zip 基于java的开发源码-SSH服务端 Apache SSHD.zip 基于java的开发源码-SSH服务端 Apache SSHD.zip 基于java的开发源码-...
该包基于Apache的sshd搭建sftp服务器,可以实现登录密钥验证,支持sftp操作和linux命令操作
ubuntu18.04.2下sshd服务安装包
linux /etc/ssh/sshd_config文件 该文件是为了对用户组进行管理 # $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $ # This is the sshd server system-wide configuration file. See # sshd...
ubuntu20.04 desktop桌面版默认是没有sshd服务的,如果要使用ssh连接又不方便联网,可以用这个离线安装包
sshd_config默认配置
sshd防止暴力破解,很实用的文档,可以看看
Android下类sshd服务,支持Root授权,提供SSH和SFTP服务
apache-sshd-1.6.0apache-sshd-1.6.0
解决提高sshd服务安全问题 解决提高sshd服务安全问题 解决提高sshd服务安全问题
使用java嵌入sshd协议连接linux或unix资源帮助文档
apache-sshd-1.6.0-srcapache-sshd-1.6.0-srcapache-sshd-1.6.0-src
sshd_config配置说明:sshd_config - OpenSSH SSH 服务器守护进程配置文件
dropbear 代替sshd 不用担心openssh的漏洞 占用资源少 虚拟主机服务器必备
centos7.9+VM虚拟机+NAT网络+共享文件夹配置+sshd配置 联网避开各种坑,VM虚拟机NAT链接不上,ping 不通外网,能ping通虚拟机,端口号ping不通。VM虚拟机SSH链接不上,VM虚拟机xshell链接不上。共享文件夹虚拟机配置...
SSH服务端 Apache SSHD.7z
ssh服务离线安装包,ubuntu 离线安装,一定要按顺序启动 sudo dpkg -i openssh-client_6.6p1-2ubuntu1_amd64.deb sudo dpkg -i openssh-sftp-server_6.6p1-2ubuntu1_amd64.deb sudo dpkg -i libck-connector0_0.4.5-...
按此方法可以成功在 windows 的 cygwin 下安装 sshd, 配置后即可从其它机器利用 ssh 命令登录
apache-sshd