점프 머신을 통해 Centos7 서버의 일부 장치에 연결하기 위해 동적 포트 전달을 사용하려고 합니다.
이 .ssh/config가 있습니다.
*Host jump
TCPKeepAlive yes
ServerAliveInterval 1200
HostName x.x.x.x
DynamicForward 1080
Host hl*
ProxyCommand nc -x 127.0.0.1:1080 %h %p*
Then I set up the dynamic port fwd in the jump machine:
*[root@host ~]#ssh -fN user@jump*
Then when i try the ssh to the final device I get this error:
*[root@host ~]#ssh user@hl4man1 -vv
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /root/.ssh/config
debug1: /root/.ssh/config line 10: Applying options for hl*
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Executing proxy command: exec nc -x 127.0.0.1:1080 hl4man1 22
debug1: permanently_set_uid: 0/0
debug1: permanently_drop_suid: 0
debug1: identity file /root/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
**Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host**
[root@host ~]#*
정적 포트 포워딩을 하면 잘 작동합니다.
어떤 아이디어가 있나요?
루이스/Rgds
답변1
중개인이 찾을 수 없는 호스트에는 프록시를 사용할 수 없습니다.
Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host
프록시 호스트가 찾을 수 있는 범위 내에 존재하는 호스트에 연결해 보시겠습니까?
즉, Bob이 Larry가 사는 곳을 모른다면 Bob에게 Larry의 집에서 물건을 가져가라고 요청할 수 없습니다.