Configuration options

SSH has many configuration options, which are settable both on the command line and also in two configuartion files. One, in /etc/ssh_config on UNIX machines, exists system-wide, and sets up the default configuration options. The second, in ~/.ssh/config on UNIX machines, is the user's configuration file, and controls the user's settings for using SSH. Placing entries in the configuration file frees you from having to specify them on the command line, however it may be more useful to use the command line for infrequently-used command like port forwarding.

There are many configuration options; to see them all with their descriptions, look at the CONFIGURATION FILES section of the man page ssh(1). The more useful options are summarized below.

Host

The name of the host (or hosts, since wildcards '*' and '?' can be used) which the configuration options following this line apply to. The host given on the ssh command line will match against the appropriate Host line of the configuration file.

Compression

One of the other nice things about SSH, in addition to it's security, is that since it replaces telnet and rlogin, it can do whatever it wants with the data... in this case, compress it. The Compression option allows the user to specify the level of compression to be used on connections with the given host. The possible values are an integer in the range [1,9], which correspond to the same GNU gzip values.

EscapeChar

Specifies the escape character for ssh to use for the connection. By default this is "~". You can also set this to "^]" to get the normal telnet|rlogin escape sequence, or set it to ``none'' to get a session which is "transparent for binary data" [quote from ssh(1)], meaning you can use it for transfering with kermit, rz, sz, etc.

HostName

Specifies the actualy hostname of the machine to connect to. This llows you to specify an alias or shortcut for a host with the Host config option, specify that alias|shortcut on the command line, and still have it connect to the correct machine. In addition, an IP address can be used for you to give a name to machines-that-have-no-name.

KeepAlive

Allows control of keepalive messages between the machines. Without keepalives, if the network or remote machine goes down, you won't notice until you try and type a command in, because the session will simply stay there. If keepalives are enabled, SSH will notice if either machine or the network goes down. However, if the network route is temporarily down the connection will close, as well.

User

Specifies the username to use for logging into this host. This frees you from having to enter the "-l username" option on the ssh command line.