openssh升级至7.2
此处升级操作的原则是保留系统原有ssh服务,新安装高版本ssh服务
1、下载openssh源码包
http://www.openssh.com/portable.html
2、安装
#tar zxvf openssh-7.2p2.tar.gz
#cd openssh-7.2p2
#./configure --prefix=/usr/local/openssh --sysconfdir=/usr/local/openssh/etc --with-pam --with-ssl-dir=/usr/local/openssl --with-md5-passwords --mandir=/usr/share/man --with-zlib=/usr/local/zlib
#make && make install
3、配置启动脚本和配置文件
cp /etc/init.d/sshd /ghca/bak/sshd #备份旧版sshd启动脚本
cp /ghca/openssh-7.2p2/contrib/redhat/sshd.init /etc/init.d/sshd ##拷贝新版启动脚本
vi /etc/init.d/sshd #编辑启动脚本
主要将以下内容
SSHD=/usr/sbin/sshd
/usr/bin/ssh-keygen -A
/sbin/restorecon /etc/ssh/ssh_host_key.pub
/sbin/restorecon /etc/ssh/ssh_host_rsa_key.pub
/sbin/restorecon /etc/ssh/ssh_host_dsa_key.pub
/sbin/restorecon /etc/ssh/ssh_host_ecdsa_key.pub
修改为:
SSHD=/usr/local/openssh/sbin/sshd
/usr/local/openssh/bin/ssh-keygen -A
/sbin/restorecon /usr/local/openssh/etc/ssh_host_key.pub
/sbin/restorecon /usr/local/openssh/etc/ssh_host_rsa_key.pub
/sbin/restorecon /usr/local/openssh/etc/ssh_host_dsa_key.pub
/sbin/restorecon /usr/local/openssh/etc/ssh_host_ecdsa_key.pub
注意:此时/usr/local/openssh/etc目录下可能没有那几个key,但是也可以先这样修改,具体这个几个key的用法还没做研究。
4、配置公私钥文件
#cd /root/.ssh
#/usr/local/openssh/bin/ssh-keygen -t rsa #生成公私钥对
#cat id_rsa.pub >> authorized_keys #写入公钥到服务器认证文件
5、将私钥文件下载保存至本地
/root/.ssh/id_rsa
6、重启sshd服务
/etc/init.d/sshd restart
7、配置本地SecureCRT并登录服务器
将对应服务器登录session配置中去掉密码验证,并配置公钥路径,如下图:
注意:openssh7.0以后就不允许root使用交互模式密码登录了,必须使用公钥登录,普通账号可以使用密码方式登录。
* The default for the sshd_config(5) PermitRootLogin option has
changed from "yes" to "prohibit-password".
* PermitRootLogin=without-password/prohibit-password now bans all
interactive authentication methods, allowing only public-key,
hostbased and GSSAPI authentication (previously it permitted
keyboard-interactive and password-less authentication if those
were enabled).
详见:http://bluereader.org/article/66465824?qqdrsign=07af0
openssh升级至7.2的更多相关文章
- CentOS openssh升级至7.4版本
1.原环境: cat /etc/issue CentOS release 6.5 (Final) ssh -V OpenSSH_7.3p1, OpenSSL 1.0.1e-fips 11 Feb 20 ...
- Centos 升级至 OpenSSH 8 rpm包制作
背景 安全部门扫描系统漏洞,OpenSSH 7.9出现漏洞,需升级到8. 使用 rpmbuild 将源码包编译为 rpm包. yum install rpm-build zlib-devel open ...
- CentOS6.5下面OpenSSH低版本升级至7.3
升级前版本: openssl-1.0.1e-48.el6_8.1.x86_64 openssh-5.3p1-118.1.el6_8.x86_64 升级后版本: OpenSSL 1.0.2j OpenS ...
- Centos6升级至openssh-7.5p1
最近公司有几台服务器需要搬至甲方(政府单位),所以在安装服务时用的是16年的openssh7.3pl, 今天通知我们有漏洞,需要再一次升级,看到官方文档上版本已升级至7.5,所以干脆直接搞7.5 具体 ...
- centos7升级openssl、openssh常见问题及解决方法
升级至openssl 1.1.1版本 升级至openssh 8.0版本 openssl version -a 当前查看版本 一.安装telnet (以防升级失败,连不上服务器,建议弄) #查看是否 ...
- mysql5.x升级至mysql5.7后导入之前数据库date出错的解决方法!
mysql5.x升级至mysql5.7后导入之前数据库date出错的解决方法! 修改mysql5.7的配置文件即可解决,方法如下: linux版:找到mysql的安装路径进入默认的为/usr/shar ...
- Ubantu【第一篇】:Ubantu中openssh连接
h3 { color: rgb(255, 255, 255); background-color: rgb(30,144,255); padding: 3px; margin: 10px 0px } ...
- .NET跨平台之旅:将示例站点从 ASP.NET 5 RC1 升级至 ASP.NET Core 1.0
终于将“.NET跨平台之旅”的示例站点 about.cnblogs.com 从 ASP.NET 5 RC1 升级至 ASP.NET Core 1.0 ,经历了不少周折,在这篇博文中记录一下. 从 AS ...
- Debian 8 jessie, OpenSSH ssh connection server responded Algorithm negotiation failed
安装了debian 8.5 就出问题了. root@debian8:~# lsb_release -aNo LSB modules are available.Distributor ID: Debi ...
随机推荐
- HttpWebRequest出错 服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF
服务器提交了协议冲突. Section=ResponseHeader Detail=CR 后面必须是 LF The server committed a protocol violation. Se ...
- Redis的AOF是怎么实现的
今天通过阅读AOF的实现代码,牵出了许多本来不是必须的话题,也都记下来先: Redis自己搞了一套事件循环机制: http://itindex.net/detail/26944-redis-%E4%B ...
- javascript基础部分
javascript基础部分 1 数据类型: 基础数据类型(通过typeof来检测):Number,string,undefined,null,boolean,function typeof只能检测 ...
- 每天一个 Linux 命令(16):which命令
我们经常在linux要查找某个文件,但不知道放在哪里了,可以使用下面的一些命令来搜索: which 查看可执行文件的位置. whereis 查看文件的位置. locate 配合数据库查看文件位置 ...
- Twitter-Snowflake,64位自增ID算法详解
Twitter-Snowflake算法产生的背景相当简单,为了满足Twitter每秒上万条消息的请求,每条消息都必须分配一条唯一的id,这些id还需要一些大致的顺序(方便客户端排序),并且在分布式系统 ...
- centOS安装网卡驱动
作为一个小白来说,安装驱动之类的真是无心下手的感觉,在学习了http://www.centoscn.com/image-text/config/2013/0816/1269.html这篇帖子的步骤之后 ...
- WEB页面采集器编写经验之一:静态页面采集器
严格意义来说,采集器和爬虫不是一回事:采集器是对特定结构的数据来源进行解析.结构化,将所需的数据从中提取出来:而爬虫的主要目标更多的是页面里的链接和页面的TITLE. 采集器也写过不少了,随便写一点经 ...
- arc下dealloc得处理
@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/c ...
- Spark On YARN使用时上传jar包过多导致磁盘空间不够。。。
今天测试过程中发现YARN Node变成Unhealthy了,后来定位到硬盘空间不够..... 通过查找大于100M的文件时发现有N多个spark-assembly-1.4.0-SNAPSHOT-ha ...
- Lucene.net 高亮显示搜索词
网站搜索关键词,往往搜索的结果中,要把用户搜索的词突出显示出来,这就是高亮搜索词的含义.而lucene也恰恰支持这样的操作.在此,我用的是盘古的组件,代码如下: PanGu.HighLight.Sim ...