DEV Community

Cover image for How to manage several SSH Config files on Mac and Linux (quick-note)
Diego Carrasco Gubernatis
Diego Carrasco Gubernatis

Posted on • Originally published at diegocarrasco.com

2 1

How to manage several SSH Config files on Mac and Linux (quick-note)

Use the Include directive to merge an external config file in the main (default) ssh config file.

  1. Create another config file as usual.
  2. Add the following line at the beginning of your ~/.ssh/config file

     Include path-to-new-config-file
    

    for example, if we have a config file in ~/Documents/.ssh/config add Include ~/Documents/.ssh/config in your main ~/.ssh/config file

What is this good for?

As I mentioned in How to use multiple SSH keys on a Mac with Github or Gitlab my objective is to s separate personal projects from work projects. In this case, I can use an ssh config file for work and another file for my projects, and then include my projects into the main config file.
This also allows me to track my changes with a private git repository without worrying about confidential information from work.

References and further reading

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay