=======================================================
yum install -y wget
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p2.tar.gz
tar -zxvf openssh-9.3p2.tar.gz
cd openssh-9.3p2
yum install -y gcc
yum install -y zlib-devel
yum install -y openssl-devel
yum install -y pam-devel
rpm -qa | grep 'gcc\|zlib-devel\|openssl-devel\|pam-devel'
./configure --prefix=/usr/local/openssh --with-ssl-dir=/bin --with-pam
make && make install
mv /lib/systemd/system/sshd.service /etc/systemd/system/sshd.service
cp /etc/ssh/sshd_config /usr/local/openssh/etc/sshd_config_ori
cat << EOF > /etc/systemd/system/sshd.service
[Unit]
Description=OpenSSH server daemon fix
#Documentation=man:sshd(8) man:sshd_config(5)
#After=network.target sshd-keygen.service
Wants=sshd-keygen.service
[Service]
#Type=notify
#EnvironmentFile=/etc/sysconfig/sshd
#ExecStart=/usr/sbin/sshd -D $OPTIONS
ExecStart=/usr/local/openssh/sbin/sshd
#ExecReload=/bin/kill -HUP $MAINPID
#KillMode=process
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl restart sshd
systemctl status sshd
rpm -e --nodeps openssh openssh-server openssh-clients
systemctl restart sshd
systemctl status sshd
systemctl enable sshd
ln -s /usr/local/openssh/bin/ssh /bin/ssh
ln -s /usr/local/openssh/bin/sftp /bin/sftp
=======================================================
'OS 기술 > Linux' 카테고리의 다른 글
LVM이 NOT available 상태일 때 (0) | 2023.09.27 |
---|---|
[Linux] Failed to start LSB: Bring up/down networking (0) | 2023.09.26 |
OpenSSH 취약점 발견에 따른 업그레이드 (CVE-2023-38408) (23) | 2023.08.01 |
dd 명령어를 이용한 더미파일 생성 (0) | 2023.07.15 |
리눅스 파일의 시간 바꾸기 (0) | 2023.07.15 |