OpenSSH SSH Client Configuration

Configuration notes for OpenSSH client on Debian Wheezy.

OpenSSH SSH Client

Install OpenSSH SSH client:

# apt-get install openssh-client

SSH client obtains configuration data from the following sources in the following order:

  1. Command-line options,
  2. User’s configuration file (~/.ssh/config),
  3. System-wide configuration file (/etc/ssh/ssh_config).

For each parameter, the first obtained value is used.

Host-specific Declaration

Example configuration:

$ cat "$HOME"/.ssh/config
Host gateway
	Port 22
	User admin
	PreferredAuthentications password,publickey
Host webserver
	Port 12
	User root
	IdentityFile /home/"$USER"/.ssh/web.pem
Host mysql-tunnel
	Port 12
	User ubuntu
	IdentityFile /home/"$USER"/.ssh/db.pem
	LocalForward 53306

General Defaults

Example configuration:

$ grep -ve "^#" -ve "^$" /etc/ssh/ssh_config
Host *
    AddressFamily inet
    Protocol 2
    PasswordAuthentication yes
    HostbasedAuthentication no
    GSSAPIAuthentication no
    GSSAPIDelegateCredentials no
    CheckHostIP yes
    SendEnv LANG LC_*
    HashKnownHosts yes

Leave a Reply

Your email address will not be published. Required fields are marked *