Host-Specific Configuration File
Instead of typing long SSH commands every time, you can define connection settings in aconfig file located at ~/.ssh/config. Each host entry acts as an alias for a full SSH command.
You can find the full list of available SSH configuration options in the ssh_config manual.
Configuration File Format
server1 simply by running:
Configuration Directives
| Directive | Description |
|---|---|
Host * | Applies settings to all hosts |
Host <remote-alias> | A custom name you can call anything you like |
ServerAliveInterval | Sends a keep-alive packet to the server at this interval (in seconds). Set to 180 to ping every 3 minutes and keep the connection open. |
StrictHostKeyChecking | When set to no, disables host key checking and automatically adds new hosts to known_hosts |
UserKnownHostsFile | Setting to /dev/null suppresses warnings about new or changed hosts |
HostName | The actual remote hostname or IP address |
Port | The port number used to connect |
User | The username used to authenticate |