升級 openssl
一、查看當前安裝的版本
# openssl version
OpenSSL 1.0.2g 1 Mar 2016
注意:不要卸載舊版本,會出依賴方面的問題!
二、下載
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
三、編譯
tar zxvf openssl-1.1.1g.tar.gz
cd openssl-1.1.1g && ./config --prefix=/usr/local/ssl shared && make && make install
編譯安裝需較長時間!!!
說明:一定要加上shared 參數,要不在安裝openssh的時候提示無法找到路徑!
四、建立軟鏈接
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/bin/openssl /usr/local/bin/openssl #僅適用Centos6
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
5.寫入openssl庫文件的搜索路徑
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
?如果出現錯誤?bash: /etc/ld.so.conf: Operation not permitted?可以嘗試使用
sudo echo "/usr/local/openssl/lib" >> /etc/ld.so.conf.d/openssl-aarch64.conf
? ? 這里因為查看?/etc/ld.so.conf?文件中引用了?/etc/ld.so.conf.d/?下的所有文件,所以自己輸出一個配置文件更合理
6.使修改后的/etc/ld.so.conf生效
ldconfig -v
7.查看openssl版本
openssl version
升級 openssh
一、查看當前版本
#ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g 1 Mar 2016
二、下載
wget -c https://ftp.riken.jp/pub/OpenBSD/OpenSSH/portable/openssh-8.3p1.tar.gz
三、編譯
tar zxvf openssh-8.3p1.tar.gz
cd openssh-8.3p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/ssl --with-pam && make && make install
個別情況下需要加以下參數編譯通過:--without-openssl-header-check
四、版本驗證
#ssh -V
OpenSSH_8.3p1, OpenSSL 1.1.1g 21 Apr 2020
五、啟動
cp /root/openssh-8.3p1/opensshd.init /etc/init.d/ssh
/etc/init.d/ssh restart
報錯及處理
- 報錯一(debian9編譯openssl):
root@192-168-11-6:~# ldd /usr/local/ssl/bin/openssl
/usr/local/ssl/bin/openssl: /usr/lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/local/ssl/bin/openssl)
/usr/local/ssl/bin/openssl: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/local/ssl/bin/openssl)
linux-vdso.so.1 (0x00007ffdd3320000)
libssl.so.1.1 => /usr/lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007febcb923000)
libcrypto.so.1.1 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007febcb48a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007febcb286000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007febcb069000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007febcacca000)
/lib64/ld-linux-x86-64.so.2 (0x00007febcbe47000)
root@192-168-11-6:~#
- 報錯二(ubuntu):
#openssl version
openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
- 報錯三(ubuntu18.04)
root@jumper:~# openssl version
openssl: relocation error: openssl: symbol EVP_mdc2 version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference
1&2&3處理方法:文章來源:http://www.zghlxwxcb.cn/news/detail-847238.html
cd openssl-1.1.1d
cp libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/
cp libssl.so.1.1 /usr/lib/x86_64-linux-gnu/
- 報錯四:configure: error: *** zlib.h missing
處理方法:
apt-get install zlib1g-dev #for ubuntu/debian
yum install zlib-devel #for centos
- 報錯五:configure: error: PAM headers not found
apt-get install libpam0g-dev #for ubuntu/debian
yum -y install pam-devel #for centos:
- 報錯六:configure: error: Your OpenSSL headers do not match your library #Debian9
添加參數后可以編譯通過。
./configure --without-openssl-header-check
- 安裝后啟動sshd報錯
/etc/ssh/sshd_config line 16: Deprecated option UsePrivilegeSeparation
/etc/ssh/sshd_config line 19: Deprecated option KeyRegenerationInterval
/etc/ssh/sshd_config line 20: Deprecated option ServerKeyBits
/etc/ssh/sshd_config line 31: Deprecated option RSAAuthentication
/etc/ssh/sshd_config line 38: Deprecated option RhostsRSAAuthentication
處理方法:
編輯配置文件,將相應行注釋掉。文章來源地址http://www.zghlxwxcb.cn/news/detail-847238.html
到了這里,關于kylin v10 升級 openssl、openssh的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!