Config File Syntax
SSH config file takes the following syntax,
Host [Alias1] Option1 [value] Option2 [value] Option3 [value] Host [Alias2] Option1 [value] Option2 [value] Host [Alias3] Option1 [value]
SSH Client reads the configuration file stanza by stanza. If more than one pattern matches, then the options from the first matching stanza take precedence. Hence, the host-specific declaration should come first and the generic declaration should be kept last.
SSH Client does not care about indentation but it’s recommended for readability.
There is numerous number of ssh options available which can be found by typing man ssh_config in Linux terminal or can check in /etc/ssh/ssh_config file for reference.
How to configure SSH Client in Linux ?
At times we may need to access multiple remote systems with different IP addresses/hostnames, usernames, non-standard-ports with various command-line options. One way is to create a bash alias for each remote connection. But we have an easy and much better solution to this problem. OpenSSH allows to create per-user configuration file to store different SSH options for each remote server. In this article, we will see the basics of SSH Client configuration with some examples.
Contact Us