Skip to main content

SSH Config File

This file is located at ~/.ssh/config

/
/~
/.ssh
/jod
/config # <- we are here
/conf.d
  • it is a plain text file with no file extension.

This is what the command ssh will read whenever you are trying to "ssh into" an instance

note

The phrase "ssh into the instance" means to establish a secure connection using Secure Shell. You would execute, for example, ssh jodgig.qa.api to ssh into the instance that is hosting your GIG's api application.

Anatomy of the SSH Config File

The following is an example of how you config files can look like.

###               ###
# jod #
### ###
Include ~/.ssh/conf.d/jod/qa.config
Include ~/.ssh/conf.d/jod/prod.config

### ###
# personal #
### ###
Include ~/.ssh/conf.d/personal/stage.config
Include ~/.ssh/conf.d/personal/dev.config
Include ~/.ssh/conf.d/personal/gitlab.config

### ###
# company-1 #
### ###
Include ~/.ssh/conf.d/company-1/stage.config
Include ~/.ssh/conf.d/company-1/dev.config
Include ~/.ssh/conf.d/company-1/gitlab.config

# Lazily adding other ssh configs directly into ~/.ssh/config
# This must be below all Include statements
Host stage.api
HostName 12.34.56.789
IdentityFile ~/.ssh/tinkerlust/stage-john.pem
User ubuntu
warning

The order of how you Include ssh config files matters.

Include must always be on top of other Host definitions