본문 바로가기
데이터 엔지니어( 실습 정리 )

Centos <<--->> 우분투 SSH 접속 알고리즘 호환 관련 설정

by 세용용용용 2024. 1. 16.

1. 구버전(Centos) , 신규서버(Ubuntu) ssh 버전

구버전 ssh 버전 : ssh -V

Openssh 5.3p1, OpenSSL 1.0.0-fips

 

신규서버 ssh 버전 : ssh -V

OpenSSH 8.9p Ubuntu-3ubuntu0.4, OpenSSL 3.0.2

 

버전 차이가 심해 ssh 접속시 키 알고리즘 오류 발생....ㅠㅜ

 

2. 신규서버(Ubuntu) 서버 설정

1./etc/ssh/sshd_config 파일에 추가

KexAlgorithms diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-rsa,ssh-dss

 

2. ssh 서비스 재시작 >> systemctl restart sshd.service

 

3. vim /root/.ssh/config (ssh 접속할 서버 ip 및 호스트 명 전체 등록)

# 구 서버(centos)
Host [ip 주소]
	HostKeyAlgorithms ssh-rsa,ssh-dss
Host [호스트 명]
	HostKeyAlgorithms ssh-rsa,ssh-dss
    
# 신규 서버(Ubuntu)
Host [ip 주소]
	KexAlgorithms diffie-hellman-group1-sha1
Host [호스트 명]
	KexAlgorithms diffie-hellman-group1-sha1

 

위의 설정을 마치게 되면 신버전 과 구버전 ssh 접속이 되는것을 확인