CentOS 6.8升级OpenSSH7.7p
近期因centos 6.x 默认openssh扫描存在大量漏洞,基于安全考虑,需要将openssh_5.3p1升级为最新版,网上查了很多教程,发现openssh存在大量依赖,不解决依赖问题很难保证其他服务政策。而openssl又被大量程序依赖。实在是头疼。最后发现一个不破坏各种依赖又可以完美升级的方案
注:curl wget yum等依赖openssl gitlab依赖openssh因卸载openssh与openssl编译安装导致各种依赖程序被破坏,虽然最后升级成功,但是wget curl 和代码库被破坏。
1、下载openssh7.7p源码包
http://www.openssh.com/portable.html
下载之后解压看readme和install
1. Prerequisites
---------------- A C compiler. Any C89 or better compiler should work. Where supported,
configure will attempt to enable the compiler's run-time integrity checking
options. Some notes about specific compilers:
- clang: -ftrapv and -sanitize=integer require the compiler-rt runtime
(CC=clang LDFLAGS=--rtlib=compiler-rt ./configure) You will need working installations of Zlib and libcrypto (LibreSSL /
OpenSSL) Zlib 1.1.4 or 1.2.1.2 or greater (earlier 1.2.x versions have problems):
http://www.gzip.org/zlib/ libcrypto (LibreSSL or OpenSSL >= 1.0.1 < 1.1.0)
LibreSSL http://www.libressl.org/ ; or
OpenSSL http://www.openssl.org/ LibreSSL/OpenSSL should be compiled as a position-independent library
(i.e. with -fPIC) otherwise OpenSSH will not be able to link with it.
If you must use a non-position-independent libcrypto, then you may need
to configure OpenSSH --without-pie. Note that because of API changes,
OpenSSL 1.1.x is not currently supported. The remaining items are optional.
官方给出的文档中提到的先决条件openssh安装依赖zlib1.1.4并且openssl>=1.0.1版本就可以了。那么直接看当前系统的openssl版本是多少
[root@zabbix-serv ~]# openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
[root@zabbix-serv ~]# rpm -q zlib
zlib-1.2.3-29.el6.x86_64
[root@zabbix-serv ~]# rpm -q zlib-devel
zlib-devel-1.2.3-29.el6.x86_64
发现自带的openssl版本符合openssh7.7p的安装条件,自带的zlib也符合OpenSSH7.7P的依赖。那么就直接安装吧。
2、打包OpenSSH
mkdir -p /usr/src/redhat/{SOURCES,SPECS}
cd /usr/src/redhat/SOURCES/
wget http://ftp.riken.jp/Linux/momonga/6/Everything/SOURCES/x11-ssh-askpass-1.2.4.1.tar.gz
tar xf openssh-7.7p1.tar.gz
cp openssh-7.7p1/contrib/redhat/openssh.spec /usr/src/redhat/SPECS/
chown sshd:sshd /usr/src/redhat/SPECS/ -R
sed -i 's@%define no_gnome_askpass 0@%define no_gnome_askpass 1@g' /usr/src/redhat/SPECS/openssh.spec
sed -i 's@%define no_x11_askpass 0@%define no_x11_askpass 1@g' /usr/src/redhat/SPECS/openssh.spec
cp /usr/src/redhat/SOURCES/openssh-7.7p1.tar.gz ~/rpmbuild/SOURCES/
cd /usr/src/redhat/SPECS/
rpmbuild -ba openssh.spec
可以看到rpm包和yum安装的是一样的。
├── RPMS
│ └── x86_64
│ ├── openssh-7.7p1-1.el6.x86_64.rpm
│ ├── openssh-clients-7.7p1-1.el6.x86_64.rpm
│ ├── openssh-debuginfo-7.7p1-1.el6.x86_64.rpm
│ └── openssh-server-7.7p1-1.el6.x86_64.rpm
[root@zabbix-serv SPECS]# rpm -qa|grep openssh
openssh-clients-5.3p1-117.el6.x86_64
openssh-5.3p1-117.el6.x86_64
openssh-server-5.3p1-117.el6.x86_64
直接替换安装rpm包
[root@zabbix-serv x86_64]# rpm -Uvh *
Preparing... ########################################### [100%]
1:openssh ########################################### [ 25%]
2:openssh-clients ########################################### [ 50%]
3:openssh-server warning: /etc/ssh/sshd_config created as /etc/ssh/sshd_config.rpmnew
########################################### [ 75%]
4:openssh-debuginfo ########################################### [100%]
安装后查看各项依赖openssl的匀使用正常。这么安装比编译安装要好很多。
[root@zabbix-serv x86_64]# sshd -V
unknown option -- V
OpenSSH_7.7p1, OpenSSL 1.0.1e-fips 11 Feb 2013
usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]
[-E log_file] [-f config_file] [-g login_grace_time]
[-h host_key_file] [-o option] [-p port] [-u len]
[root@zabbix-serv x86_64]# ssh -V
OpenSSH_7.7p1, OpenSSL 1.0.1e-fips 11 Feb 2013
[root@zabbix-serv x86_64]# curl baidu.com -I
HTTP/1.1 200 OK
Date: Wed, 25 Apr 2018 16:37:49 GMT
Server: Apache
Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT
ETag: "51-47cf7e6ee8400"
Accept-Ranges: bytes
Content-Length: 81
Cache-Control: max-age=86400
Expires: Thu, 26 Apr 2018 16:37:49 GMT
Connection: Keep-Alive
Content-Type: text/html [root@zabbix-serv x86_64]# wget -q baidu.com
[root@zabbix-serv x86_64]# yum list >>/dev/null
测试yum安装,依赖openssh的是否会将7.7p替换为5.3p
[root@zabbix-serv x86_64]# yum install openssh*
Loaded plugins: fastestmirror, security
Setting up Install Process
Examining openssh-7.7p1-1.el6.x86_64.rpm: openssh-7.7p1-1.el6.x86_64
openssh-7.7p1-1.el6.x86_64.rpm: does not update installed package.
Examining openssh-clients-7.7p1-1.el6.x86_64.rpm: openssh-clients-7.7p1-1.el6.x86_64
openssh-clients-7.7p1-1.el6.x86_64.rpm: does not update installed package.
Examining openssh-debuginfo-7.7p1-1.el6.x86_64.rpm: openssh-debuginfo-7.7p1-1.el6.x86_64
openssh-debuginfo-7.7p1-1.el6.x86_64.rpm: does not update installed package.
Examining openssh-server-7.7p1-1.el6.x86_64.rpm: openssh-server-7.7p1-1.el6.x86_64
openssh-server-7.7p1-1.el6.x86_64.rpm: does not update installed package.
Error: Nothing to do
CentOS 6.8升级OpenSSH7.7p的更多相关文章
- centos 6.5 升级openssh-7.5
1.环境 2.安装telnet 服务,防止ssh升级之后登陆不上服务器,使用telnet 连接服务器 yum install telnet-server -y chkconfig telnet on ...
- CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)
---恢复内容开始--- CentOS 6.6 升级GCC G++ (当前最新GCC/G++版本为v6.1.0) 没有便捷方式, yum update.... yum install 或者 添加y ...
- Centos 6.5升级到Git2.1.2的步骤
Centos 6.5升级到Git2.1.2的步骤 Centos 6.5升级到Git2.1.2其实是非常的简单,因这款版本控制程序非常的好用,所以小编自己也是使用它了,下面一起来看看Centos 6.5 ...
- CentOS 6.9 升级MySQL 5.6.36到5.7.18
CentOS 6.9 升级MySQL 5.6.36到5.7.18 MySQL 5.6.36 安装过程:http://www.cnblogs.com/imweihao/p/7156754.html 升级 ...
- Centos 6.x 升级到 7.x
Centos6.5跨越大版本升级到Centos7.4 - Linux学习与应用 - CSDN博客https://blog.csdn.net/whbttst/article/details/805348 ...
- 【转】CentOS 6.6 升级GCC G++ (当前最新版本为v6.1.0) (完整)
原文地址:https://www.cnblogs.com/lzpong/p/5755678.html 我这里是centos7 升级到gcc8.1,过程差不多,参考这篇文章,记录一下. ---原文--- ...
- CentOS 7下升级MySQL5.7.23的一个坑
发现CentOS 7下升级MySQL5.7.23的一个坑,以前面升级到MySQL 5.7.23的一个集群为例 在我们环境下打开文件描述符个数的参数open_files_limit在MySQL 5.6. ...
- CentOS 6 下升级安装Mysql 5.5 完整步骤
使用系统CentOS 6.2本来已经系统自带安装了mysql 5.1,但是奈何5.1不支持utf8mb4字符集(详见:http://blog.csdn.net/shootyou/article/det ...
- CentOS 6.5 升级内核到 3.10.28
本文适用于CentOS 6.4, CentOS 6.5,亲测可行,估计也适用于其他Linux发行版. 1. 准备工作 1.1 下载源码包 Linux内核版本有两种:稳定版和开发版 ,Linux内核版本 ...
随机推荐
- HNOI2019 游记
HNOI2019 游记 Day 0 其实考前几天,心里还是挺慌的.结果最后 Day 0 的时候,因为种种原因反而释然了.也许是觉得,在这一步退役,也没有什么好害怕的吧. OI 本身就是一项偶然性太大的 ...
- Hdoj 2050.折线分割平面 题解
Problem Description 我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目.比如,一条折线可以将平面分成两部分,两条折线最多可以将平面 ...
- sql语句循环截取字符串
测试环境 : mssql2016 express 需求 : 拆分字符串执行insert 思路 : 在循环中截取分隔符之间的字符串.起止点位置计算 起点从0开始startIndex,查找第一个分隔 ...
- iis express添加虚拟目录
在调试WEB时,还是使用IIS EXPRESS比较方便, 在IIS中,选择网站,右击,添加虚拟目录或者应用程序,就能添加虚拟目录了.. 在IIS EXPRESS中,添加虚拟目录如下 1.右击IIS E ...
- django restframework 环境配置
Requirements: coreapi (1.32.0+) - Schema generation support.Markdown (2.1.0+) - Markdown support for ...
- 20165223 结对编程之四则运算week1-阶段性总结
目录 一.结对对象 二.需求分析 三.设计思路 四.功能截图 五.结对感受 一.结对对象 担任角色 驾驶员(Driver):20165223 蔡霓(是控制键盘输入的人) 领航员(Navigator): ...
- Typescript学习笔记(四)class 类
typescript的类,与c#,java等语言的类类似.也是包含了一大部分的es6的实现.我会用最通俗的语言讲一下对coding有用的地方. class Greeter { greeting: st ...
- KVM环境安装macOS Sierra
一.在macOS系统中生成ISO文件:1.在App Store中搜索.下载macOS Sierra系统. App Store --> macos --> macOS Sierra --&g ...
- navicat primium 快捷键与命令
1.ctrl+q 打开查询窗口 2.ctrl+/ 注释sql语句 3.ctrl+shift +/ 解除注释 4.ctrl+r 运行查询窗口的s ...
- 生成SSH密钥添加到GitHub
将自己的过程和踩坑写下来 一.检查是否有SSH 1.打开Git的目录文件,下图是我电脑中git的文件目录 2.点击git-bash.exe,输入ssh查看电脑中是否已存在ssh,会出现以下结果,证明已 ...