I typically find myself with voluminous bashrc files filled with aliases and functions for connecting to specific hosts via ssh. I would like an easier way to manage the various ssh hosts, ports, and keys.
First, always remember to RTFM,
This is an excellent starting point, the man page contains plenty of information on all the ins-and-outs of an ssh config.
To get started, simply create a plaintext file "config" in your .ssh/ directory.
$HOME/.ssh/config will be used by your ssh client and is able to set per-host defaults for username, port, identity-key, etc
# $HOME/.ssh/config Host dev HostName dev.anattatechnologies.com Port 22000 User twarnock ForwardAgent yes
On this particular host, I can now run
$ ssh dev
Which is much easier than "ssh -A -p 22000 firstname.lastname@example.org"
You can also use wildcards, e.g.,
Host *amazonaws.com *ec2.nytimes.com *.dev.use1.nytimes.com User root
which I find very useful for cases where usernames are different than my normal username.
Additionally, you can add tunneling information in your .ssh/config, e.g.,
Host tunnel.anattatechnologies.com HostName anattatechnologies.com IdentityFile ~/.ssh/anattatechnologies.key LocalForward 8080 localhost:80 User twarnock
Even if you chose to use shell functions to manage tunnels, the use of an ssh config can help simplify things greatly.