0

I have this .config file for SSH hosts:

Host 10.32.1.43
  HostName 10.32.1.43
  User root
  ForwardAgent yes
Host 10.32.0.39
  HostName 10.32.0.39
  User administrator
  ForwardAgent yes

Can I give more friendly names to my machines, instead of remembering which of them is the Ubuntu machine, and which is the CentOS?

Gama11
  • 31,714
  • 9
  • 78
  • 100
baruchiro
  • 5,088
  • 5
  • 44
  • 66

1 Answers1

9

If you change the Host line it changes the name displayed in VSCode and normal ssh commands

Host example
   HostName myexampleip.local
   User example

using this example config file can be used with this command ssh example

NOTE (as mnagel has commented)

The user-friendly name goes behind "Host" and the IP/hostname to connect to goes behind "Hostname".

Blake Lockley
  • 2,931
  • 1
  • 17
  • 30
  • 2
    this is basically right albeit i don't find the example very well-picked. the user-friendly name goes behind "Host" and the IP/hostname to connect to goes behind "Hostname". – mnagel Nov 01 '19 at 19:13