sshtunnel
sshtunnel copied to clipboard
Behavior of host_pkey_directories is incorrect
Documentation for the host_pkey_directories
says:
host_pkey_directories (list):
Look for pkeys in folders on this list, for example ['~/.ssh'].
Default: ``None`` (disabled)
However in the get_keys
function, at line 1089:
if host_pkey_directories is None:
host_pkey_directories = [DEFAULT_SSH_DIRECTORY]
I think this is wrong. If host_pkey_directories is None, the function get_keys should not return any key.
Passing a empty list seems to work as workaround
This is a bug because it means that the behaviour in newer versions is incompatible with old ones. In older versions pkeys would not be searched for by default and you could force the use of a particular pkey (only) by passing ssh_pkey. Now you need to specify host_pkey_directories=[] to get the same behaviour. Would a PR to fix this be accepted?
@mhardcastle could you pleas send a PR