If you’re on a Mac and want to connect to another computer over SSH via your Terminal, you can create a shortcut so that instead of typing
> ssh server1.ops.somedomain.com
you can just enter
> ssh server1
You can also specify which user you’d like to connect as. To set this up,
- open a Terminal window
- change to your ssh folder, i.e. cd .ssh
- create a config file, if one doesn’t already exist, touch config
- edit the config file, e.g. vi config
- add a record for each shortcut you’d like separated by a blank line, e.g.
Host server1
HostName server1.ops.somedomain.com
Host server2
User john
HostName server2.ops. somedomain.com
Exit your SSH connection and then reconnect using the shortcut, e.g. > ssh server1