From 3d9bf7d93b261c2ad0badd6d16fc898516abedab Mon Sep 17 00:00:00 2001 From: Luke Overend Date: Mon, 23 Oct 2017 11:35:53 +0100 Subject: [PATCH] Pass password when using ssh key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it is not possible to use a ssh key with a passphrase. `paramiko` defines `password` as follows: ``` password (str) – a password to use for authentication or for unlocking a private key ``` This change passes the password when using a private key allowing the use of a passphrase protected private key. --- napalm_junos/junos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/napalm_junos/junos.py b/napalm_junos/junos.py index 098dc40..9bf5338 100644 --- a/napalm_junos/junos.py +++ b/napalm_junos/junos.py @@ -88,6 +88,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) if self.key_file: self.device = Device(hostname, user=username, + password=password, ssh_private_key_file=self.key_file, ssh_config=self.ssh_config_file, port=self.port)