Ssh – Eroor: $ ssh: Could not resolve hostname [HOSTNAME]: Name or service not known

amazon ec2bastionport-forwardingsshssh-tunnel

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

Best Answer

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..