OS/Linux
[Linux] - OpenSSH 9.0v 업데이트(CentOS 7.5)
개발계발게발
2022. 6. 24. 17:06
반응형
OpenSSH 9.0v 업데이트
CentOS 7.5에서 진행
필요 패키지 설치
zlib-devel, openssl-devel, pam-devel, gcc, make, wget
yum install zlib-devel openssl-devel pam-devel gcc make wget
wget 으로 openssh 9.0 버전 다운로드
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.0p1.tar.gz
기존 OpenSSH 삭제
openssh 패키지 확인
rpm -qa | grep openssh
openssh 삭제
rpm -e --nodeps openssh openssh-clients openssh-server
openssh 패키지 제거 후 확인
rpm -qa | grep openssh
rpm -e --nodeps openssh openssh-clients openssh-server
OpenSSH 9.0v 압축 해제, 컴파일 및 설치
압축 해제
tar -zxvf openssh-9.0p1.tar.gz
압축 해제된 openssh-9.0p1 폴더에서 컴파일 후 설치
./configure --prefix=/usr/local/openssh --with-ssl-dir=/usr/local/openssl/bin --with-pam --with-md5-passwords
make && make install
OpenSSH 9.0 구성 및 systemctl 등록
sshd.pam.generice 파일을 sshd로 복사(/etc/pam.d/ 경로)
cp ./contrib/sshd.pam.generic /etc/pam.d/sshd
sshd.service 파일 생성 및 아래 내용 입력 후 저장
vi /etc/systemd/system/sshd.service
[Unit]
Description=SSH Server
[Service]
ExecStart=/usr/local/openssh/sbin/sshd
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
systemctl 데몬 리로드, ssh 실행, 부팅시 ssh 실행 등록, ssh status 확인
systemctl daemon-reload
systemctl start sshd
systemctl enable sshd
systemctl status sshd
※ root 로그인 허용(sshdconfig 수정)
vi /usr/local/openssh/etc/sshd_config
PermitRootLogin 주석 해제 및 yes로 변경
OpenSSH 버전 확인
ssh -V
반응형