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

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

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

Host aliasname
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?


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


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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