解决更新ssh后在/etc/init.d下无sshd的问题
1.将远程服务器的/etc/init.d/ssd 文件拷贝到本地
scp /etc/init.d/ssh root@IP地址:/etc/init.d
2.vi /etc/init.d/sshd
3.将原有的sshd文件内容清除,然后复制以下内容便可
#!/bin/sh
# Start/stop/restart the secure shell server: sshd_start() {
# Create host keys if needed.
if [ ! -r /etc/ssh/ssh_host_key ]; then
/usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
/usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
fi
if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
/usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
fi
/usr/sbin/sshd
} sshd_stop() {
killall sshd
} sshd_restart() {
if [ -r /var/run/sshd.pid ]; then
echo "WARNING: killing listener process only. To kill every sshd process, you must"
echo " use 'rc.sshd stop'. 'rc.sshd restart' kills only the parent sshd to"
echo " allow an admin logged in through sshd to use 'rc.sshd restart' without"
echo " being cut off. If sshd has been upgraded, new connections will now"
echo " use the new version, which should be a safe enough approach."
kill `cat /var/run/sshd.pid`
else
killall sshd
fi
sleep 1
sshd_start
} case "$1" in
'start')
sshd_start
;;
'stop')
sshd_stop
;;
'restart')
sshd_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
4.重启过程中有报错的情况,请查看报错代码修改sshd文件内容,直到运行正常。
解决更新ssh后在/etc/init.d下无sshd的问题的更多相关文章
- 解决关闭ssh后网页停止服务的方法,利用nohup
上一篇文章提到宝塔面板无法运行,只能用ssh运行app.py. 关闭ssh时,app.py会被杀死.因为app.py的父进程就是ssh,关掉ssh会造成进程被杀死. 解决方法参考 https://w ...
- 解决安装fiddler后IE打开网页提示“代理服务器无响应”
环境:win8.1+IE11 安装fiddler4后,启动fiddler,IE11打开百度网站,打开失败:代理服务器无响应,如图: 在网上找了各种方法,修改fiddler的设置,均无法解决这个问题,无 ...
- 解决jQuery uploadify在非IE核心浏览器下无法上传
之前上传了一个通过Flash实现多文件上传,但是在IE正常运行,FireFox 不能正常上传.经过反复研究学习,之所以firefox和360浏览器无法正常运行,是因为FireFox.chrome.36 ...
- 更新xcode后插件失效问题——不针对特定版本的通用解决方法
一.Xcode更新后插件失效的原理 1.每次更新Xcode后插件都会失效,其实插件都还在这个目录好好的躺着呢: ~/Library/Application Support/Developer/Shar ...
- 解决mac更新系统后git无法使用
这只是个小笔记啊,记着以后忘了可以再找出来,你们遇到了这个问题也可以翻出来看,废话不多说了,直接讲吧 一.无法使用的原因 mac 更新系统后 git命令无法使用,输入git命令会出现这样的提示 进 ...
- 解决在sdk manager中更新文件后出现This Android SDK requires Android Developer Toolkit version 23.1的错误
起因:在sdksdk manager中更新了adt及其它的支持库后,eclipse报错:This Android SDK requires Android Developer Toolkit vers ...
- 更新xcode后插件失效问题——不针对特定版本的通用解决方法
一.Xcode更新后插件失效的原理 1.每次更新Xcode后插件都会失效,其实插件都还在这个目录好好的躺着呢: ~/Library/Application Support/Developer/Shar ...
- React Native (0.57)开发环境搭建(注意:Node不要随便更新到最新版,更新完后莫名其妙的问题一大堆)
搭建开发环境 一.安装依赖 必须安装的依赖有:Node.Watchman 和 React Native 命令行工具以及 Xcode. 1.首先安装 Homebrew 2.安装 Node, Watchm ...
- [加入用户]解决useradd 用户后没有加入用户Home文件夹的情况,Linux改变文件或文件夹的訪问权限命令,linux改动用户password,usermod的ysuum安装包。飞
usermod的yum安装包: shadow-utils 将nobody用户加入到nogroup 组: usermod -g nogroup nobody cat /etc/passwd|grep n ...
随机推荐
- 修复Microsoft Store 无法连接网络 代码: 0x80072EFD
事情的经过是这样的,我的Windows版本是1709,前两天刚从1703升上来,今天突然发现它自己给我装了个skype,我上Microsoft商店里查一下是什么情况,结果突然发现它又双双双不正常工作了 ...
- Linux上Oracle18C 系统表空间大小调整 adjust the system tablespace for oracle18c on linux
1. 测试过程中,发现 system tablespace is not enough, need to adjustment 初步解决方案: 查询一下 system tablespace的大小 S ...
- windows下vmware配置nat网络
linux学习需要配置网络,可以选择桥接网络,nat网络地址转换. 由于linux的服务,众多需要配置一个固定的ip,因此可以选择静态ip配置. 因此在这里自定义nat网络地址转换,可以固定一台lin ...
- py2neo的使用(转)
转自:https://blog.csdn.net/sinat_26917383/article/details/79901207#24-%E7%B1%BB%E4%BC%BCset%E7%9A%84%E ...
- Centos7下杀毒软件clamav的安装和使用
目录 一.yum安装 二.编译安装 2.1:下载软件包 2.2:创建clamav用户和存放病毒库目录 2.3:解压安装包 2.4:安装依赖 2.5:编译安装 2.6:配置clamav 2.7:启动cl ...
- C#客户端和服务端数据的同步传输 (转载)
客户端: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;u ...
- 云笔记项目-Spring事务学习-传播REQUIRES_NEW
接下来测试事务传播的REQUIRES_NEW. Service层 Service层代码在这里不展示了,主要将EMPService1Impl类中的方法事务传播属性设置为REQUIRED,EMPServi ...
- margin居中显示
标签(空格分隔): margin居中 margin居中: 如下图的代码查看: <!DOCTYPE html> <html lang="en"> <he ...
- 执行python文件报错SyntaxError: Non-ASCII character '\xe8' in file, but no encoding declared
在文件头部加上: # -*- coding: utf-8 -*
- vue-computed计算属性用法
siytem函数可以当做变量在html中展现,列:{{siytem}} v-for(item in siytem)遍历也可以. 这个函数是从获取到的数据中,得到值后再次提取里面的数据,通过下标 me ...