Skip to content

Commit

Permalink
Using "auth_method": "password" ignores SSH keys and agent (#108)
Browse files Browse the repository at this point in the history
Don't look for keys if using password (fixes #98)
  • Loading branch information
bordaigorl authored Oct 10, 2021
1 parent db17694 commit 49b7112
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rmview/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ class rMConnect(QRunnable):
_known_hosts = None

def __init__(self, address='10.11.99.1', username='root', password=None, key=None, timeout=3,
onConnect=None, onError=None, host_key_policy=None, known_hosts=None, **kwargs):
onConnect=None, onError=None, host_key_policy=None, known_hosts=None, auth_method=None, **kwargs):
super(rMConnect, self).__init__()

self.address = address
self.username = username
self.password = password
self.timeout = timeout
self.auth_method = auth_method
self.host_key_policy = host_key_policy
self._known_hosts = known_hosts

Expand Down Expand Up @@ -138,6 +139,11 @@ def _initialize(self):
'pkey': self.pkey,
'timeout': self.timeout,
}

if self.auth_method == 'password':
self.options['look_for_keys'] = False
self.options['allow_agent'] = False

except Exception as e:
self._exception = e

Expand Down

0 comments on commit 49b7112

Please sign in to comment.