Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.