How do you provide a custom SSH Config file to Nornir?

Taken from: https://networktocode.slack.com/archives/C82409LEL/p1561644348362000

hi

i’m trying to use a ssh proxy to connect to a serveral machines via nornir.
i created a ssh_conf file (https://pynet.twb-tech.com/blog/automation/netmiko-proxy.html)
but how do I set the ssh_config file for nornir ?
thanks

1 Like

There are two main ways that I’ve solved this to date:

  1. Put it in your Nornir configuration file:

     ssh:
         config_file: "/blah/blah/blah/ssh_config"`
    
  2. Put it in your group configuration to specify specific files per group for unique settings as needed:

     my_fws:
       port: 8443
       platform: cisco_asa
       connection_options:
         netmiko:
           extras:
             secret: 'another_password'
             ssh_config_file: '/blah/blah/the_other_ssh_config'
2 Likes

Does it work the same for windows also?
Thanks

You will need a valid windows path but it should work. However, as I don’t have a windows machine I can’t test and know for sure.