root@csb134:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
一、准备工作
1. 配置国内镜像源
为了加速依赖包下载,建议先切换为国内镜像源。
Ubuntu 20.04 LTS (focal)
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
Ubuntu 22.04 LTS (jammy)
deb https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
sudo vim /etc/xinetd.d/telnet
service telnet {
= no
flags = REUSE
socket_type = stream
= no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
}
cd /usr/local/src
wget https://github.com/openssl/openssl/releases/download/openssl-3.5.4/openssl-3.5.4.tar.gz
# 内网环境请替换为内部源地址# sudo wget http://10.1.0.67/softs/openssl-3.5.4.tar.gz
tar -xzf openssl-3.5.4.tar.gz
cd openssl-3.5.4
openssl version
# 输出:OpenSSL 3.5.4 xx xxx xxxx 则证明安装成功
三、编译安装 OpenSSH
下载源码
cd /usr/local/src
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-10.2p1.tar.gz
# 内网环境请替换为内部源地址# sudo wget http://10.1.0.67/softs/openssh-10.2p1.tar.gz
tar -xzf openssh-10.2p1.tar.gz
cd openssh-10.2p1