Skip to main content

SSH Config Directory

This directory is located at ~/.ssh/conf.d

/
/~
/.ssh
/jod
/config
/conf.d # <- we are here

The .d in conf.d unix means "directory".

While Unix OS does not need a .d to identify that that path is a directory/folder, it's to prevent ambigouity for humans.

  • ~/.ssh/conf could refer to a text file or a folder since there is not file extension.
  • By appending .d it's apparent that it's a folder, and not a file.

Since we would to split our main configuration file (i.e. ~/.ssh/config) into smaller files, we would need to store them in a directory/folder.

Grouping configs by evironment

Imagine if you had 10 servers/instances for each environment, you would have a very long ~/.ssh/config file that would have a total of 100 lines.

  • 4 lines per host config x 20 instances = 80 lines + 20 empty lines afte reach host config = 100 lines

Generally you would have different types of developement environments. Some common examples are:

  • dev (a.k.a development)
  • test
  • stage (a.k.a staging)
  • prod (a.k.a production)

Depending on your setup, you would have one ssh config file for each envionment.

In Jod, we have the following environments:

  • qa
  • prod
  • demo (ignore demo for now.)

So you would create the following files:

  • ~/.ssh/conf.d/jod/qa.config
  • ~/.ssh/conf.d/jod/prod.config
  • ~/.ssh/conf.d/jod/demo.config
/
/~
/.ssh
/jod
/config
/conf.d
/jod # company/project name folder
/stage.config # you would create this file
/prod.config # you would create this file
note

Some companies require high specs to run their applications and may provide you a development environment on the cloud.

In this scenario, you would want to have a ~/.ssh/conf.d/company-name/dev.config file to store all the ssh connection configs for your development environment.