
AWS에 Bastion Host를 설정하고 있습니다. 자세한 내용은 다음과 같습니다.https://www.nadeau.tv/ssh-with-a-bastion-host/), AWS에 있는 다른 EC2 인스턴스에 안전하게 액세스할 수 있도록 합니다.
요새 호스트를 통해 프록시를 시도할 때 몇 가지 문제가 발생합니다.
내 SSH 구성 파일은 다음과 같습니다.
# Bastion Host
Host bastion
User ec2-user
Hostname XX.XX.XX.XXX
IdentityFile ~/.ssh/keys/bastion.pem
# EC2 Instance
Host 172.*
User ec2-user
IdentityFile ~/.ssh/keys/bastion.pem
ProxyCommand ssh bastion -W %h:%p
다음은 명령줄의 자세한 출력입니다.
Jeff-Bezos-iMac:tmp jeff$ ssh 172.xx.x.xx -v
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/jeff/.ssh/config
debug1: /Users/jeff/.ssh/config line 9: Applying options for 172.*
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Executing proxy command: exec ssh bastion -W 172.xx.x.xx:22
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jeff/.ssh/keys/bastion.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jeff/.ssh/keys/bastion.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: permanently_drop_suid: 503
channel 0: open failed: connect failed: Connection timed out
stdio forwarding failed
ssh_exchange_identification: Connection closed by remote host
'stdio 전달 실패' 오류가 발생하여 막혔습니다. 도움을 주시면 감사하겠습니다.
문안 인사
답변1
SSH 보안 그룹을 올바르게 구성하지 않았습니다. Bastion Server의 개인 IP에서 들어오는 SSH 요청을 수락하도록 변경했을 때 모든 것이 예상대로 작동했습니다.
답변2
제 경우에는 Bastion/Jumpbox 호스트가 호스트 이름을 확인할 수 없었기 때문에(IP가 아닌 호스트 이름을 사용했습니다) 제 경우에는 DNS 설정에 잘못된 DNS 항목이 있었기 때문에 Bastion 호스트가 다음을 확인할 수 있는지 확인하세요. SSH 구성 파일에서 사용하는 것과 동일한 이름입니다.
답변3
Bastion Host에 설정하고 다시 시작 AllowTcpForwarding yes
( ) 했더니 연결 문제가 해결되었습니다./etc/ssh/sshd_config
sshd
systemctl restart sshd.service