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
	HostName 10.0.0.1
	Port 22
	User admin
	PreferredAuthentications password,publickey
Host webserver
	HostName www.example.com
	Port 12
	User root
	IdentityFile /home/"$USER"/.ssh/web.pem
Host mysql-tunnel
	HostName db.example.com
	Port 12
	User ubuntu
	IdentityFile /home/"$USER"/.ssh/db.pem
	LocalForward 53306 127.0.0.1:3306

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 *