You can do this by adding a line like below into ~/.ssh/config
Host alias domain.com HostName domain.com User aUser
This allows you to just write `ssh alias` and it will convert it to ssh aUser@domain.com.
You can do this by adding a line like below into ~/.ssh/config
Host alias domain.com HostName domain.com User aUser
This allows you to just write `ssh alias` and it will convert it to ssh aUser@domain.com.
IdentifyFile /path/to/key/file
when I have different hosts that require different keys to access, this is very useful so I don't have to specify them every time
and agent forwarding is useful as well, for example, I can push to github from a vm using my laptop ssh key and I don't have to generate an additional key for the vm
ForwardAgent true
with the new Windows terminal, I setup different tabs to be SSH to different machines based on my .ssh/config file
{ "guid": "{1c9b268e-7606-4a07-b097-d8bc62fb5207}", "hidden": false, "name": "ubuntu.localdomain", "commandline": "ssh.exe me@ubuntu", "colorScheme": "Elementary" }, { "guid": "{b7161acc-8235-4283-9a85-e93df3d09125}", "hidden": false, "name": "db.localdomain", "commandline": "ssh.exe me@db", "colorScheme": "Ubuntu" },
Windows Terminal with a very nicely define ssh config is a killer combo.
If you have multiple keys in your agent, you _really_ should manually configure what key to present using `-i` or `IdentityFile`. But you should also use `IdentitiesOnly` too.
So definitely have a custom ~/.ssh/config
Possibly a different key for each machine, especially public because your public key can be used to identify you.
My only wish is that there was a way to define a backup hostname/IP of the first is down (my laptop has different IP on local WiFi, local wired, remote) and a way to specify multiple names for a host (on PC, I usually use NAS or the full IP address; on my phone I usually just use the last octet or lowercase nas); it would be nice to have the same file configured and in use across all my devices, with only a single configuration block for each.