Include directive to include an external config file in the main
(default) ssh config file.
- Create another config file as usual.
- Add the following line at the beginning of your
for example, if we have a config file in
Include ~/Documents/.ssh/configin your main
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.