Upgrade OpenSSH Version on Kylin V10
OpenSSH_8.2p1 to OpenSSH_10.0p2
[root@host1 ~]# cat /etc/os-release NAME="Kylin Linux Advanced Server" VERSION="V10 (Tercel)" ID="kylin" VERSION_ID="V10" PRETTY_NAME="Kylin Linux Advanced Server V10 (Tercel)" ANSI_COLOR="0;31" [root@host1 ~]# uname -a Linux host1.novalocal 4.19.90-23.48.v2101.ky10.aarch64 [root@host1 ~]# sshd -V OpenSSH_8.2p1, OpenSSL 1.1.1f 31 Mar 2020
Download openssh/openssl/zlib package to openssh directory.
openssh:https://mirrors.aliyun.com/pub/OpenBSD/OpenSSH/portable/openssh-10.0p1.tar.gz
openssl:https://www.openssl.org/source/openssl-3.3.1.tar.gz
zlib:https://www.zlib.net/zlib-1.3.1.tar.gz
[root@host1 ~]# mkdir openssh [root@host1 ~]# ls openssh openssh-10.0p1.tar.gz openssl-3.3.1.tar.gz zlib-1.3.1.tar.gz
Create an install.sh script.
#!/bin/bash check () { if [ "$?" != "0" ] then echo -e "\e[31m Install OpenSSH Failed!!! \e[0m" exit 6 fi } echo -e "\033[32m Begain Installing. \033[0m" tar -zxf openssh-10.0p1.tar.gz tar -zxf openssl-3.3.1.tar.gz tar -zxf zlib-1.3.1.tar.gz cd zlib-1.3.1/./configure --prefix=/usr/local/zlib check make && make install check cd ../openssl-3.3.1/./configure --prefix=/usr/local/openssl check make -j 4 && make install check echo "/usr/local/openssl/lib" >> /etc/ld.so.confldconfig ldconfig -p | grep ssl echo "export PATH=/usr/local/openssl/bin:$PATH " >> /etc/profilesource /etc/profilecheck mv /etc/ssh /etc/ssh_bakmv /usr/bin/ssh /usr/bin/ssh_bakmv /usr/bin/ssh-keygen /usr/bin/ssh-keygen_bakmv /usr/sbin/sshd /usr/sbin/sshd_bakcp -a /etc/pam.d/sshd /etc/pam.d/sshd_bakcd ../openssh-10.0p1/./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-pam --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/zlib check make && make install check cp -a /usr/local/openssh/sbin/sshd /usr/sbin/sshdcp -a /usr/local/openssh/bin/ssh /usr/bin/sshcp -a /usr/local/openssh/bin/ssh-keygen /usr/bin/ssh-keygencp -a /root/openssh/openssh-10.0p1/contrib/redhat/sshd.init /etc/init.d/sshdchmod +x /etc/init.d/sshdecho "PermitRootLogin yes" >> /etc/ssh/sshd_configecho "PubkeyAuthentication yes" >> /etc/ssh/sshd_configecho "PasswordAuthentication yes" >> /etc/ssh/sshd_configcat > /etc/systemd/system/sshd.service << 'EOF' [Unit] Description=OpenSSH Server After=network.target [Service] ExecStart=/usr/local/openssh/sbin/sshd -f /etc/ssh/sshd_config Restart=on-failure [Install] WantedBy=multi-user.target EOF chmod +x /etc/systemd/system/sshd.servicesystemctl daemon-reload systemctl enable sshd systemctl restart sshd echo -e "\033[32m The new OpenSSH Version: \033[0m" sshd -V
Run the install.sh script.
[root@host1 ~]# cd openssh [root@host1 openssh]# ls install.sh openssh-10.0p1.tar.gz openssl-3.3.1.tar.gz zlib-1.3.1.tar.gz [root@host1 openssh]# bash install.sh
Check.
[root@host1 ~]# sshd -V OpenSSH_10.0p2, OpenSSL 3.3.1 4 Jun 2024