If you've seen my previous posts, you would know that I recently finished installing/basic setup of SSH to my ubuntu based server. I've seen one of my dev friends use the following command to get into his server:

user@linux ~$ ssh amy

How do I make it so I can do something similar (in my case ssh dc) to get into my server easier? Remembering the IP and port number is real annoying...


You can use ~/.ssh/config to create connection profiles, which can set the address, the username, the port number, or any other parameters that are settable from the command line:

Host dc
    Hostname 2001:db8:4321::abcd:efgh
    Port 5453
    User fred

This of course only works on your own computers. If you need a mechanism that works from absolutely everywhere, then you need DNS, i.e. use a domain name (whether your own or a subdomain under a friend's domain). Of course it would still be ssh dc.mydomain.com in that case, and DNS cannot help you with ports or usernames – only IP addresses.

  • Perfect! Thanks – amyiris Nov 27 '19 at 6:22

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.