Host configuration

Host Configuration

Host Specific Configuration file

Create a config filename config in your local ~/.ssh directory.

nano ~/.ssh/config

You can define each individual SSH configuration options into this file. You can find all the SSH configuration options from this ssh_config (opens in a new tab).

~/.ssh/config
Host * # all hosts
  ServerAliveInterval 180
  StrictHostKeyChecking no
  UserKnownHostsFile /dev/null

Host <remove-alias>
  HostName <remote-host/ipaddress>
  Port <port-number>
  User <username>

Host <remote-alias>
  HostName <remote-host/ipaddress>
  Port <port-number>

# sample
Host server1
  HostName 192.168.0.1
  Port 22
  User karchunt
DeclarationDescription
Host *All hosts
Host remote-aliasYou can name remote-alias whatever you want
ServerAliveIntervalIf set 180, then every 3 minutes, send a packet to the server to let it know not to close the connection
StrictHostKeyCheckingIf set "no", it will disable host checking and it will auto-add new hosts to the known_hosts file (fingerprint) directly
UserKnownHostsFileNot warn on new or changed hosts
HostNameremove host name or IP Address
PortPort number to access
UserUsername used to access