Issue
For Ruby, using 2 spaces is the best. For Python, using 4 spaces is the best.
But for ssh config file, how many spaces is the best?
Solution
I found the originally accepted answer a bit confusing so I thought I'd contribute some additional information.
To the original question, ssh config files allow, but do not require, indentation with whitespace (either tabs or spaces). Blank lines and lines beginning with a hash # are ignored.
The config file consists of stanzas, each beginning with the reserved word Host
or Match
followed by a list of options until the stanza ends at the next Host
, Match
or end of file.
The options can be specified as name value
or name=value
. Looking at the OpenSSH release notes, it appears the developers use the name=value
format. Leading whitespace is ignored. Unquoted in-line whitespace is also ignored
The following (mixing with and without equals and whitespace) are equivalent
Host test1
Hostname = 192.168.0.100
Host test1
Hostname 192.168.0.100
Host=test1
Hostname 192.168.0.100
Note that the equal sign is significant when parsing options. Values with embedded equals signs need to be quoted. This contrived example demonstrates what happens without quotes.
Host test1
Hostname = 192.168.0.100
UserKnownHostsFile /tmp/name_with=equals /tmp/name2
Will look for known host in /tmp/name_with
and in /tmp/name2
but not in /tmp/name_with=equals
.
Answered By - user2070305 Answer Checked By - Cary Denson (WPSolving Admin)