Add option to use SSH Tunnels
hendriksthomas opened this issue · 1 comments
hendriksthomas commented
Scenario
In my team's setup we use virtualized routers and connect to them using the hypervisors (Ubuntu) as jump hosts for SSH tunneling. We have used ncclient in the past and relied on it working with SSH Tunnels configured in ~/.ssh/config. This is currently not possible with pySROS though it could be.
Proposed change
Modify the definition of management::connect
Line 40 in 988434a
and the creation of a Connection object therein
Line 131 in 988434a
to allow for an optional parameter ssh_config that is passed to the ncclient manager via the Connection constructor and set to None by default. If None, this parameter will change nothing. If this parameter is True, the ncclient will use a platform-specific value as an SSH configuration file. If set to a path, the file located at this path will be used by ncclient instead.
Advantages
It is a relatively small change and allows flexibility for users to use, test and develop scripts using pySROS through SSH tunnels.