# Config : ssh
The format of the `/etc/ssh/ssh_config`, `/etc/ssh/ssh_config.d/*`, and `~/.ssh/config` files used by the `ssh` command. \[ [man page](https://manpages.ubuntu.com/manpages/jammy/man5/crontab.5.html) ]
Example `~/.ssh/config` file:
```
Host *
IdentityFile ~/.ssh/id_ed25519
```
###### Basics
- each section (begun by `Host` directive) applies to the specified host pattern
- indentation is optional but recommended
- params are specified as keyword-argument pairs
- keywords are case-insensitive, but arguments are case-sensitive
- for each param, the first value is used, so put more specific sections before more generic ones
- ignores lines that are empty or start with `#`
- quoting is optional, but necessary when argument contains spaces
- if it exists, the `~/.ssh/config` file should be chmod 600
###### Host Patterns
```
Host foo.com
...
Host bar.com baz.com # multiple patterns separated by whitespace
...
Host b??.com !bar.com # ? = single-char wildcard, ! = not
...
Host 192.168.0.* # also supports IP addresses
...
Host myalias # can use aliases instead of actual hostnames or IP addresses
... # must then specify HostName param
Host *
...
```
###### Parameters
```
HostName foo.com
IdentityFile /path/to/key # default: ~/.ssh/id_rsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ecdsa_sk,
# ~/.ssh/id_ed25519, ~/.ssh/id_ed25519_sk, ~/.ssh/id_dsa
LogLevel # options: QUIET, FATAL, ERROR, INFO (default)
# VERBOSE, DEBUG/DEBUG1, DEBUG2, DEBUG3
Port 1234 # default: 22
User myusername # default: local username
```