1

I am on windows 10 machine. I need to ssh to our Bastion and then do port forwarding to connect to AWS instance. I have a config file that I use to ssh. My config file is as following:

Host [host]
  IdentityFile myprivatekey
  CheckHostIP no
  HostName [myhostname]
  User myuser
  LocalForward 3900 ip-XX.XXX.XX.XXX.eu-west-1.compute.internal:3389

When I do ssh [host] I get the following error:

Error: $ ssh: Could not resolve hostname [HOSTNAME]: Name or service not known

HBruijn
  • 77,029
  • 24
  • 135
  • 201
Salah
  • 41
  • 1
  • 5

2 Answers2

2

I solved it. I recreated my private key and i moved to .ssh folder then i changed the path in my config file to :

~/.ssh/myprivatekey

Then it worked..

Salah
  • 41
  • 1
  • 5
-1

It looks like a dns issue.

To figure out, try in cmd.exe : ping myhostname

It should not work.

Then you have two option :

  • add myhostname in your dns server

Or

  • add myhostname 1.2.3.4 (replace 1.2.3.4 with correct ip) in system32\driver\etc\hosts
bgtvfr
  • 1,262
  • 10
  • 20