0

I am using the following to successfully connect to a server:

ssh -i /path/to/cert.pem username@12.34.56.78

I would like to create an alias for my host. I have the following in my .ssh/config

Host aliasname
Hostname 12.34.56.78
User username
IdentityFile /path/to/cert.pem

Then when I enter ssh aliasname it says: ssh: Could not resolve hostname aliasname: Name or service not known. Have I missed something?

xylar
  • 167
  • 8

2 Answers2

0

The config was valid. The problem was my network connection had gone offline. Someone pass me a dunce hat.

xylar
  • 167
  • 8
0

it may not be reading your config, or your config is broken otherwise. use ssh -v to see which data config it is loading from, and paste your output here. the config entry you listed seems to be correct, at least for the current version of ssh. also, make that the first entry to avoid something else clobbering it. what is your distro and ssh version, by the way, so that others with the same can help you more.

johnshen64
  • 5,865
  • 24
  • 17