Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

openssh - user config

Status
Not open for further replies.

w5000

Technical User
Nov 24, 2010
223
PL

hello,
was there any change from some openssh version that following does not work anymore?

here only simple example of the config:

Host host2
Hostname localhost

Host host1
Hostname host2


when I run ssh host1 it fails:

$ ssh host1
ssh: Could not resolve hostname host2: no address associated with name

It for sure worked in the past, even in big cascade of "hostname"s configured in ~/.ssh/config




 
$ ssh host1
ssh: Could not resolve hostname host2: no address associated with name


DNS resolver problem, host2 has no IP address ('A' Record) associated with it, you either need to add an entry for it to the local hosts file, use the fully qualified domain name or the IP in the ssh command line.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 

no, it is not the way it worked before. please note that ssh client read user's config and no hosts entry was needed - for the value on Hostname if corresponding stanza existed in the config, which was used in another stanza with that name on "Host"

here is a complex tunneling which was working for me perfectly at "one shot" but now it is no longer working for unknown reason....

in this config example, only the jumphost name was resolvable locally - the marked in colors were known by ssh as in config file and it worked (still work by only each single - no more in cascade).
server1/server2 in proxycommands are of course resolvable on remote machines given proxycommand connects to.

in other words, when I run
ssh server2-10-120-77-9-tun

I got immediately prompt on the last server in cascade tunnel / and desired 8000 tunnel was established locally on my pc.

it is really strange.

Code:
Host [COLOR=#FCE94F]server1-10-120-77-11-hop[/color]
     Hostname jumphost
     User userdev
     IdentityFile ~/.ssh/l1
     ProxyCommand ssh -i ~/.ssh/l1 -2 -q -x userdev@%h -W server1:22
     HostKeyAlias server1-10-120-77-11-hop

Host [COLOR=#8AE234]server2-10-120-77-9-hop[/color]
     Hostname [COLOR=#FCE94F]server1-10-120-77-11-hop[/color]
     User userdev
     IdentityFile ~/.ssh/l2
     ProxyCommand ssh -i ~/.ssh/l2 -2 -q -x userdev@%h -W server2:22
     HostKeyAlias server2-10-120-77-9-hop

Host [COLOR=#729FCF]server2-10-120-77-9-tun[/color]
     HostName [COLOR=#8AE234]server2-10-120-77-9-hop[/color]
     User userdev
     LocalForward 8000 127.0.0.1:8000
     GatewayPorts yes

 

hmmm, now I realized that only this connections returns the error:
ssh server2-10-120-77-9-tun

when start "the middle" conenction:
ssh server2-10-120-77-9-hop

it does work(sic!).




Code:
Host [COLOR=#CC0000]server1-10-120-77-11-hop[/color]
     Hostname jumphost
     User userdev
     IdentityFile ~/.ssh/l1
     ProxyCommand ssh -i ~/.ssh/l1 -2 -q -x userdev@%h -W server1:22
     HostKeyAlias server1-10-120-77-11-hop

Host [COLOR=#4E9A06]server2-10-120-77-9-hop[/color]
     Hostname [COLOR=#CC0000]server1-10-120-77-11-hop[/color]
     User userdev
     IdentityFile ~/.ssh/l2
     ProxyCommand ssh -i ~/.ssh/l2 -2 -q -x userdev@%h -W server2:22
     HostKeyAlias server2-10-120-77-9-hop

Host server2-10-120-77-9-tun
     HostName [COLOR=#4E9A06]server2-10-120-77-9-hop[/color]
     User userdev
     LocalForward 8000 127.0.0.1:8000
     GatewayPorts yes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top