Show Contents / Index / Search

Host Stanzas

Host stanzas are supported in client configuration files. Use host stanzas to apply different settings to different hosts. To create a host stanza, use a regular expression that identifies an individual host or a group of hosts. Place this at the beginning of a new line, followed by a colon (:). This line cannot contain white space. When you initiate a connection, the client matches host stanza expressions against the host name you specify for that connection. If the host stanza expression matches your specified host, values within that stanza are applied to the connection. The client continues to search for matching host stanzas and applies any relevant settings until the end of the file is reached. Because the last value of a keyword overrides any previous value for the same keyword, you need to place global settings above host-specific settings. Settings outside of any stanza apply to all connections, but can be superseded by subsequent settings placed within a stanza.

You can configure global settings by creating a stanza labeled with ".*:" Settings in this stanza apply to any host you specify on the command line.

Note: Global settings configured in this stanza do not apply to a connection in which no host is specified. To make a successful connection without specifying a host, you must use a configuration file in which the Host keyword appears outside of a host stanza.

The following example sets the default user name to `joe', and changes the user name to `guy' for connections to samplehost.





Related Topics

Client Configuration Files

Configuration File Format