OpenSSH Config File Examples For Linux / Unix Users

The OpenSSH config file is typically located at /etc/ssh/ssh_config and ~/.ssh/config. This file can be used to configure various options and settings for the OpenSSH client, such as setting a preferred port number, specifying private key files, enabling compression, and more. A common example of using the config file is to set up a shortcut for frequently used connections:

Host example
HostName example.com
User username
Port 22
IdentityFile ~/.ssh/id_rsa

In this example, you can connect to the host example.com with the username username using the private key ~/.ssh/id_rsa by simply typing ssh example in the terminal.

Leave a Comment