Loading...

CentOS 5 更新 openssh 7.1p2 及 openssl 1.0.1s

Temperature: 0 °C

蘇恆永 蘇恆永
author_tools

最近被 highlight openssh 必須更新至 7.2p2.
CentOS5 真是有夠古老的,
一堆套件都沒有更新.

所以只能自己製作 RPM 了.
製作過程發現 openssh 7.2p2 必須配合 openssl 0.9.8f 以後版本!!
所以連 openssl 也一起更新到 1.0.1s ( 0.9.8 和 1.0.0 已經 Out of service 了)

!!! 用這個方法更新後 yum 更新會有問題 (反正 CentOS5 已經很久沒更新了, 沒差)

參考: 
Url link
Url link
Url link


0. 因為要自己 build rpm, 要先安裝必要套件

yum install rpm-build gcc make wget openssl-devel krb5-devel pam-devel libX11-devel xmkmf libXt-devel


!!!!!openssh 7.2p2 需要 openssl >= 0.9.8f
!!!!! CentOS 5 只更新到 0.9.8e

1. 下載並解開 openssl 1.0.1s
wget https://www.openssl.org/source/openssl-1.0.1s.tar.gz .
tar zxvf openssl-1.0.1s.tar.gz


2. 複製檔案
cp openssl-1.0.1s/openssl.spec /usr/src/redhar/SPECS
cp openssl-1.0.1s.tar.gz /usr/src/redhat/SOURCES


3. 儲存 patch 檔. 把下列內容儲存為 openssl-centos5.patch
--- /root/openssl-1.0.1s/openssl.spec 2016-03-01 21:40:46.000000000 +0800
+++ openssl.spec 2016-03-21 17:01:46.000000000 +0800
@@ -116,7 +116,7 @@
%doc CHANGES CHANGES.SSLeay LICENSE NEWS README
%attr(0755,root,root) /usr/bin/*
-%attr(0755,root,root) /usr/lib/*.so*
+%attr(0755,root,root) /usr/lib64/*.so*
%attr(0755,root,root) %{openssldir}/misc/*
%attr(0644,root,root) /usr/man/man[157]/*
@@ -129,8 +129,8 @@
%defattr(0644,root,root,0755) %doc CHANGES CHANGES.SSLeay LICENSE NEWS README
-%attr(0644,root,root) /usr/lib/*.a
-%attr(0644,root,root) /usr/lib/pkgconfig/openssl.pc
+%attr(0644,root,root) /usr/lib64/*.a
+%attr(0644,root,root) /usr/lib64/pkgconfig/openssl.pc
%attr(0644,root,root) /usr/include/openssl/*
%attr(0644,root,root) /usr/man/man[3]/*


4. Patch openssl.spec
patch /usr/src/redhat/SPECS/openssl.spec < openssl-centos5.patch 


5. 製作 rpm
rpmbuild -bb /usr/src/redhat/SPECS/openssl.spec


6. 安裝 rpm
cd /usr/src/redhat/RPMS/x86_64/
rpm -Uvh openssl-1.0.1s-1.x86_64.rpm openssl-debuginfo-1.0.1s-1.x86_64.rpm openssl-devel-1.0.1s-1.x86_64.rpm openssl-doc-1.0.1s-1.x86_64.rpm --nodeps


Openssh 7.2p2

7. 下載並解開 openssh 7.2p2
wget http://mirror.internode.on.net/pub/OpenBSD/OpenSSH/portable/openssh-7.2p2.tar.gz .
tar zxvf openssh-7.2p2.tar.gz


8.複製檔案
cp openssh-7.2p2/contrib/redhat/openssh.spec /usr/src/redhat/SPECS/
cp openssh-7.2p2.tar.gz /usr/src/redhat/SOURCES/


9. 調整
cd /usr/src/redhat/SPECS sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" openssh.spec sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" openssh.spec sed -i -e "s/BuildPreReq/BuildRequires/g" openssh.spec


10. build RPM
rpmbuild -bb /usr/src/redhat/SPECS/openssh.spec


結果會卡在 slogin 及 slogin.1 找不到的錯誤,
主要是 openssh 7.2 已經沒有 slogin 了,
但 openssh.spec 還沒改.    
必須修改 /usr/src/redhat/SPECS/openssh.spec,
把 363, 364 行註解掉.
之後重 build rpm 就 OK 了.

11 安裝 rpm
cd /usr/src/redhat/RPMS/x86_64/
rpm -Uvh openssh-7.2p2-1.x86_64.rpm openssh-clients-7.2p2-1.x86_64.rpm openssh-debuginfo-7.2p2-1.x86_64.rpm openssh-server-7.2p2-1.x86_64.rpm

 

三重湯城園區 Go

https://innstory.com/story-CentOS_5_更新_openssh_71p2_及_openssl_101s-642

Prev
 免費電子書下載

Next
一堆設計資源,_記錄一下 

Nearby Attractions

三重湯城園區-Nearby Attractions

  • 滬尾水道 Go
  • 新莊武聖廟 Go
  • 大觀義學 Go
  • 台北放送局板橋放送所 Go
  • 淡水海關碼頭 Go
  • 學海書院(今高氏宗祠) Go

About the Author

蘇恆永

重新 pickup 本能中

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

Linux 連線數調校.

Linux 連線數調校.

最近常常遇到連線數太多(因為底層 WebService 太忙了). web 最後連不上...

一堆設計資源, 記錄一下

一堆設計資源, 記錄一下

設計資源總匯 奧革設計 奧革設計團隊精心整理的設計師必備設計資源,收藏各式各樣的靈感、...

Python TimeUUID

Python TimeUUID

參考這一篇: 什麼時候讓用 time UUID,https://samkuo.me/...

Recommended reading

Other stories happened at this address

Python TimeUUID

Python TimeUUID

參考這一篇: 什麼時候讓用 time UUID,https://samkuo.me/...

Python Pragmatic Unicode

Python Pragmatic Unicode

記錄一下 Python Pragmatic Unicode http://...

Python Pragmatic Unicode

Python Pragmatic Unicode

記錄一下 Python Pragmatic Unicode http://...

免費電子書下載

免費電子書下載

太晚看到了, 每天都有免費程式設計相關的電子書可以下載 https://www....

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format