How to use shorthand names for hostnames with ssh? You don’t always want to type in a complete host name when using ssh to remote hosts. Here is how to configure and use shorthand hostnames with ssh.
If you want to configure shortened names for your servers & hosts for use with SSH, follow the next steps:
Open up your
and add the following:
Host your_short_name HostName server.on.the.web User user_to_user
Save the file and exit (
Now you can use ‘
ssh your_short_name‘ instead of:
ssh -l username this-is-my-long-hostname.example.com.
Pretty neat, right?! :-)
My name is Jan. I am not a hacker, coder, developer or guru. I am merely a systems administrator, doing my daily thing at Vevida.
If you feel a post has helped solve your problem, or has saved you time, please consider making a donation. You can transfer a direct donation through Paypal or via bank wire-transfer IBAN: NL31 ABNA 0432217258 (Jan Reilink). Thanks!