Customize SSH config for every login


/ Published in: Bash
Save to your folder(s)

Changing default settings

The defaults for the ssh-related commands can be altered for each account in a configuration file ~/.ssh/config (there is also a system-wide file, usually /etc/ssh/ssh_config). Each entry starts with a Host keyword. You can use wildcards to match all the appropriate systems:

* ? matches any single character
* * matches any sequence of zero or more characters

Usual keywords include (defaults in parenthesis):

Compression yes/no (no)
Controls whether compression is used on the connection.
CompressionLevel 1-9 (6)
Level of compression: 1 is fastest, 9 is slowest (achieves best compression). Compression is good for slow links (saves bandwidth) and fast machines.
FallBackToRsh yes/no (yes)
If a secure connection to the remote system cannot be established the commands can try unsecure connections (a warning will be displayed if this happens). On highly secure systems this could be disabled in the system-wide configuration.
KeepAlive yes/no (yes)
Controls whether TCP keepalive messages are used. When enabled it is possible to detect network outages and automatically close your connections (which is good). However, if you are connected over a dialup link that automatically dials when there is traffic, you will want to turn this off to avoid unnecessarily bringing up the line.
User account (local account)
Specify the remote account name. Add this to avoid having to use the -l option when issuing commands.


For a complete list of options see sshd_config(5): http://netbsd.gw.com/cgi-bin/man-cgi?sshd_config+5

NOTE: Host can alternately set an alias name for a Hostname

URL: http://kimmo.suominen.com/docs/ssh/#config

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.