I keep having to type out ssh myusername@somereallylonghost.numb3r5.ojd202nk.net a lot. Instead of an alias, I just want to shorten that host name. I tried editing my hosts file to include shorthost somereallylonghost.numb3r5.ojd202nk.net at the bottom, but it's not resolving when I try to connect as ssh myusername@shorthost. Can anyone tell me why?
|
|
|||
|
|
|
Use the ssh config file instead. The file path is Example config:
Then you can just run |
||||
|
|
|
Please accept @ggustafsson's solution. But since you asked why
|
|||
|
|
|
If your only concern is
(optionally, you could also add your somereallylonghost at the end of that, so that would also be resolved regardless of some DNS server being available). But keep in mind you'd have to update that line whenever the IP of your verylonghostnametoreplaceinthiscase changes -- which is not the case with the ssh config approach. |
|||
|
|