Proxycommand and ncat not work with dynamic port fwd

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite












Im trying to connect to some devices from a Centos7 server, via a jump machine using dynamic port fwd.



I have this .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 ~]#*


If I do a static port forwarding it works fine.



Any idea?



Rgds / Luis







share|improve this question

















  • 1




    'Could not resolve hostname "hl4man1"'
    – Ipor Sircer
    Jul 12 at 15:02














up vote
-1
down vote

favorite












Im trying to connect to some devices from a Centos7 server, via a jump machine using dynamic port fwd.



I have this .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 ~]#*


If I do a static port forwarding it works fine.



Any idea?



Rgds / Luis







share|improve this question

















  • 1




    'Could not resolve hostname "hl4man1"'
    – Ipor Sircer
    Jul 12 at 15:02












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











Im trying to connect to some devices from a Centos7 server, via a jump machine using dynamic port fwd.



I have this .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 ~]#*


If I do a static port forwarding it works fine.



Any idea?



Rgds / Luis







share|improve this question













Im trying to connect to some devices from a Centos7 server, via a jump machine using dynamic port fwd.



I have this .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 ~]#*


If I do a static port forwarding it works fine.



Any idea?



Rgds / Luis









share|improve this question












share|improve this question




share|improve this question








edited Jul 12 at 15:00









Ipor Sircer

8,6181920




8,6181920









asked Jul 12 at 14:58









gimeno_l

1




1







  • 1




    'Could not resolve hostname "hl4man1"'
    – Ipor Sircer
    Jul 12 at 15:02












  • 1




    'Could not resolve hostname "hl4man1"'
    – Ipor Sircer
    Jul 12 at 15:02







1




1




'Could not resolve hostname "hl4man1"'
– Ipor Sircer
Jul 12 at 15:02




'Could not resolve hostname "hl4man1"'
– Ipor Sircer
Jul 12 at 15:02










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You can't proxy to a host which your man-in-the middle can't find.



Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host


Try connecting to a host that exists insofar as the proxy host can find?



Put another way, you can't ask Bob to get something from Larry's house if Bob doesn't know where Larry lives.






share|improve this answer





















  • Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
    – gimeno_l
    Jul 12 at 15:15










  • Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
    – DopeGhoti
    Jul 12 at 15:20










  • The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
    – gimeno_l
    Jul 12 at 17:18










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454919%2fproxycommand-and-ncat-not-work-with-dynamic-port-fwd%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













You can't proxy to a host which your man-in-the middle can't find.



Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host


Try connecting to a host that exists insofar as the proxy host can find?



Put another way, you can't ask Bob to get something from Larry's house if Bob doesn't know where Larry lives.






share|improve this answer





















  • Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
    – gimeno_l
    Jul 12 at 15:15










  • Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
    – DopeGhoti
    Jul 12 at 15:20










  • The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
    – gimeno_l
    Jul 12 at 17:18














up vote
0
down vote













You can't proxy to a host which your man-in-the middle can't find.



Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host


Try connecting to a host that exists insofar as the proxy host can find?



Put another way, you can't ask Bob to get something from Larry's house if Bob doesn't know where Larry lives.






share|improve this answer





















  • Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
    – gimeno_l
    Jul 12 at 15:15










  • Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
    – DopeGhoti
    Jul 12 at 15:20










  • The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
    – gimeno_l
    Jul 12 at 17:18












up vote
0
down vote










up vote
0
down vote









You can't proxy to a host which your man-in-the middle can't find.



Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host


Try connecting to a host that exists insofar as the proxy host can find?



Put another way, you can't ask Bob to get something from Larry's house if Bob doesn't know where Larry lives.






share|improve this answer













You can't proxy to a host which your man-in-the middle can't find.



Ncat: Could not resolve hostname "hl4man1": Name or service not known. QUITTING.
ssh_exchange_identification: Connection closed by remote host


Try connecting to a host that exists insofar as the proxy host can find?



Put another way, you can't ask Bob to get something from Larry's house if Bob doesn't know where Larry lives.







share|improve this answer













share|improve this answer



share|improve this answer











answered Jul 12 at 15:04









DopeGhoti

39.7k54679




39.7k54679











  • Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
    – gimeno_l
    Jul 12 at 15:15










  • Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
    – DopeGhoti
    Jul 12 at 15:20










  • The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
    – gimeno_l
    Jul 12 at 17:18
















  • Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
    – gimeno_l
    Jul 12 at 15:15










  • Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
    – DopeGhoti
    Jul 12 at 15:20










  • The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
    – gimeno_l
    Jul 12 at 17:18















Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
– gimeno_l
Jul 12 at 15:15




Hi, hl4man1 is known by the jump host. I can ssh user@hl4man1 from the jump host.
– gimeno_l
Jul 12 at 15:15












Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
– DopeGhoti
Jul 12 at 15:20




Is this because the host is defined in the ssh config on the jump host? Because nc doesn't read that.
– DopeGhoti
Jul 12 at 15:20












The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
– gimeno_l
Jul 12 at 17:18




The jump host uses DNS in the remote network to access all the nodes, the name of nodes in which im interested in start with hl*.
– gimeno_l
Jul 12 at 17:18












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f454919%2fproxycommand-and-ncat-not-work-with-dynamic-port-fwd%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay