Using SSH Config Files

Often times, users who rely on SSH for server administration or git SSH logins prefer (or are forced) to use separate and distinct SSH key files for their clients.

Administration of multiple SSH key files (aka identity files) can be greatly reduced through the use of an ssh config file.

The ssh config file is placed within the user’s ~/.ssh/ directory and named simply “config.”

The layout of the file is as follows:

The config file can have as many “Host” definitions as you like. When referencing the hostname in SSH from the command line, the config file will be parsed for the pertinent details.

Using the above config file I would only need to type “ssh foo” to SSH into my server.

Alternatively, anytime you attempt an SSH connection to a server, the ~/.ssh/config file is parsed. If a host matches, the relevant details are used to initiate the connection.

This allows you to manage multiple hosts and use different SSH key files to log in. The full list of options for the ~/ssh/config file can be found in the man page ssh_config(5).

SSH gives you secure remote access connection to network devices. Communication between the client and server is encrypted. Security is our priority at Contegix and we love sharing this passion. Please contact us for more information on how we can secure your network.