2

I'm learning "startup engineering", encountered this error when using ssh alias. Below is the detailed steps (executed in Cygwin windows 8):

$ mkdir -p ~/.ssh $ cp ~/downloads/skey.pem ~/.ssh/ $ chmod 400 ~/.ssh/skey.pem $ chmod 700 ~/.ssh $ nano ~/.ssh/config $ cat ~/.ssh/config Host awshost1 HostName ec2-54-218-35-71.us-west-2.compute.amazonaws.com User ubuntu IdentityFile "~/.ssh/skey.pem" 

Then I ran below command

ssh awshost1 

But it prompts

ssh: Could not resolve hostname awshost1: hostname nor servname provided, or not known

And the verbose output:

$ ssh -vv awshost OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013 debug1: Reading configuration data /etc/ssh_config debug2: ssh_connect: needpriv 0 ssh: Could not resolve hostname awshost: hostname nor servname provided, or not known 

Would anyone please help me on this? Thanks.

3 Answers 3

4

As you can see from the output, your ssh-client reads /etc/ssh_config, not ~/.ssh/config. Try to connect like that: ssh -F ~/.ssh/config awshost1.

0
0

you can run ssh-host-config

and place your ssh config in /etc/ssh_config which will make it work flawlessly

0

In my situation I found cygwin didn't install its own version of openSSH by default.

When I run in cygwin terminal

 ssh myServer 

The Windows' ssh is running and it looks for config file under

 c:\users\computerName/.ssh/config 

This is solved by running cygwin setup setup-x86_64.exe and adding openssh

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.