本文件針對於ssh版本低於7.0的系統,公升級為openssh-8.0p1。
ssh –v2 openssh-8.0安裝步驟[root@kuajing-db3 ~]# ssh -v
openssh_5.3p1, openssl 1.0.0-fips 29 mar 2010
解除安裝原有openssh
yum remove openssh -y準備編譯環境:
yum install gcc openssl-devel zlib-devel上傳openssh安裝包到/mnt並解壓進行編譯:
tar zxvf openssh-8.0p1.tar拷貝ssh服務檔案cdopenssh-8.0./configure
make && make install
cp /usr/local/bin/ssh /usr/bin/ssh修改配置檔案cp /usr/local/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub
cp /mnt/openssh-8.0p1/contrib/redhat/sshd.init /etc/init.d/sshd
cp ./contrib/redhat/sshd.init /etc/init.d/sshd
修改/etc/ssh/sshd_config
將#permitrootlogin修改為permitrootlogin yes
修改/usr/libexec/sftp-server為/usr/local/libexec/sftp-server
修改 /etc/init.d/sshd
將sshd=/usr/sbin/sshd 改為 sshd=/usr/local/sbin/sshd
將/usr/sbin/ssh-keygen -a 改為 /usr/local/bin/ssh-keygen -a
在 『$sshd $options && success || failure』這一行上面加上一行 『options="-f /etc/ssh/sshd_config"』
加入系統服務
chkconfig --add sshd檢查服務chkconfig sshd on
chkconfig --list |grep sshd啟動服務sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
service sshd start檢查ssh版本
[root@oracle ~]# ssh -vopenssh-8.0p1, openssl 1.0.1e-fips 11 feb 2013根據以上公升級過程編寫了指令碼自動執行操作,指令碼內容如下:
#!/bin/bashsshinst()
chg_sshd()
" /etc/init.d/sshd`
if [ -z "$" ];then
sed -i '/$sshd $options &&/i\\t'"$"'' /etc/init.d/sshd
else
echo $
fipath_exist=`grep "$" /etc/init.d/sshd`
if [ -n "$" ];then
echo "$"
else
sed -i "s:$:$:" /etc/init.d/sshd
fiecho "/etc/init.d/sshd file changes completed."
}chg_conf()
" /etc/ssh/sshd_config`
if [ -z "$" ];then
sed -i "s:$:$:" /etc/ssh/sshd_config
else
echo "$"
fiecho "/etc/ssh/sshd_config file changes completed."}
opath=/usr/
npath=/usr/local/
echo -n "the ssh current version is:"
ssh -v
while true;do
echo -n "continue to update?(yes/no)"
read input
case $input in
y|y|yes|yes)
sshinst
echo -n "press any key to continue....."
read anykey
cp /usr/local/bin/ssh /usr/bin/ssh
echo "copying ssh....done."
cp /usr/local/etc/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ecdsa_key.pub
echo "copying ssh_host_ecdsa_key.pub....done."
cp /mnt/openssh-7.5p1/contrib/redhat/sshd.init /etc/init.d/sshd
echo "copying sshd....done."
chg_sshd
chg_conf
break;;
n|n|no|no)
echo exited
exit ;;
"")break;;
esac
done
chkconfig --add sshd
chkconfig sshd on
service sshd start
echo "operation is completed."
openssh內網公升級到8 0版本
提取碼 2i7w 2.安裝 rpm ivh telnet server 0.17 39.el5.x86 64.rpm 3.配置檔案 vi etc xinetd.d telnet 把 disable yes 改為 disable no 4.重啟 service xinetd restart 5.tel...
OpenSSH怎麼更新公升級到8 1
1.安裝必要元件 yum install y gcc openssl devel pam devel rpm build wget openssh 8.1p1.tar.gz tar zxvf openssh 8.1p1.tar.gz3.到openssh 8.1p1目錄下編譯並安裝最新版openssh...
公升級openssh到高版本
linux公升級openssh到高版本 可以解決openssh 安全漏洞 cve 2018 15919 和ssh伺服器型別和版本 2 安裝依賴和元件 yum install y gcc openssl devel pam devel rpm build 3 備份cp r etc ssh sshbac...