# Quick Tip: SSH Config

> Create short hostname aliases in ~/.ssh/config to simplify SSH connections

- Author: Curtis Miller
- Published: 2008-08-23
- Categories: ops, how-to
- Canonical URL: https://millarian.com/posts/quick-tip-ssh-config/

It's easy to create shortcuts for all those servers you need to SSH into. There should be a file in your `.ssh` directory called `config`. Simply add a few lines to this file and you can refer to those servers by their short name.

## Example (~/.ssh/config)

```bash
Host foo
  Hostname some.long.hostname.you.cannot.remember.com
  User myuser
  Port 1234
```

Now you can use your new host when you SSH.

```bash
$ ssh foo
```

If you want to get even fancier, read the man page for additional options.

```bash
$ man ssh_config
```

Setup as many as you need and free yourself from SSH hostname hell!
