正統 OpenSSH 公升級 簡單說明

2022-09-09 13:30:23 字數 2052 閱讀 2571

此輕量版公升級不包含 fips 模組和對 pam 的支援

需肥胖版請跳至附錄 a

基於 redhat 6.10 minimal 編寫

[ @~ ]# yum install gcc zlib-devel
上傳公升級原始碼包至伺服器至 root 使用者家目錄 ( 預設 /root/ )

[ @~ ]# mkdir -p /opt/openssl

[ @~ ]# mkdir -p /opt/openssh

[ @~ ]# ls openss*.tar.gz | xargs -n1 tar xzvf
[ @~ ]# cd openssl*

[ @openssl* ]# ./config --prefix=/opt/openssl

[ @openssl* ]# make

[ @openssl* ]# make install

[ @openssl* ]# cd

[ @~ ]# echo '/opt/openssl/lib/' >> /etc/ld.so.conf.d/openssl.so.conf

[ @~ ]# ldconfig

[ @~ ]# /opt/openssl/bin/openssl version

[ @~ ]# cd openssh*

[ @openssh* ]# ./configure --prefix=/opt/openssh --with-ssl-dir=/opt/openssl

[ @openssh* ]# make

[ @openssh* ]# make install

[ @openssh* ]# cd

[ @~ ]# /opt/openssh/bin/ssh -v

至此,新 openssl 與 openssh 安裝工作已完成,接下來是移除舊的 openssh-server 與 openssh-clients 程式,系統原有關於 openssl 的包不做任何更改

[ @~ ]# yum remove openssh openssh-server openssh-clients
[ @~ ]# echo 'export path=$path:/opt/openssh/bin' >> /etc/profile.d/ssh.sh

[ @~ ]# source /etc/profile

[ @~ ]# echo 'permitrootlogin yes' >> /opt/openssh/etc/sshd_config
此時可以發起新的 ssh 連線到此伺服器,但若此前已 ssh 連線過伺服器,那麼還需要刪除客戶端使用者 ~/.ssh/known_hosts 中關於此伺服器的公鑰

以下兩種操作二選一

[ @~ ]# ln -s /opt/openssh/sbin/sshd /usr/sbin/sshd

[ @~ ]# sed '42,46d' ./openssh*/contrib/redhat/sshd.init > /etc/init.d/sshd

[ @~ ]# service sshd start

[ @~ ]# chkconfig sshd on

[ @~ ]# echo '/opt/openssh/sbin/sshd' >> /etc/rc.d/rc.local

[ @~ ]# chmod +x /etc/rc.d/rc.local

[ @~ ]# source /etc/rc.local

至此,輕量版 openssh 公升級工作已完成

有需求,再新增

aug 21, 2020

FormatMessage簡單說明

常用引數簡介.formatmessage format message from system format message allocate buffer,null,lval,null,lptstr hlocal,0,null 第乙個引數是標誌,告訴這個formatmessage函式,我想要的特點...

Subversion 簡單說明

subversion 簡單說明 checkout 從源 管理伺服器取出 commit 提交更新的 到源 管理伺服器。update 從源 管理伺服器獲取 的最新更新。export 從源 管理伺服器匯出 匯出的 將脫離源 管理。revert 將當前資料恢復到最近與伺服器同步的版本,即放棄自己的所有未提交...

std deque簡單說明

本文 http blog.chinaunix.net u2 86575 showart 1734758.html std deque是乙個高效的雙端佇列,可以高效地進行插入和刪除操作。以sgi c stl為例 deque的基本結構是 有乙個map map中的元素是乙個記錄了乙個大小為512位元組的線...