Closed youk closed 6 months ago
The issue is present in 1.8.1 as well.
I again got the situation when the specified key was ignored. As it turned out, the cause was that OpenSSH considered permissions on the key file as too open and rejected it, printing the warning and switching to password authentication. The confusion stems from Plumbum not displaying stderr
, where OpesSSH prints the warning. I could, at least in theory, redirect stderr
to stdout
for individual command. But how do I do that when using with SshMachine()
? I see no options available.
As for the original report, I cannot replay it and confirm it wasn't caused by permissions on the key file. As such, I am going to close the issue. The key file is not ignored, this is just insufficient error reporting.
I can't get ssh with key authentication to work. The
keyfile
attribute seems to be ignored and the program keeps asking for user password. There's even no difference when I specify invalid path to the key file. There's no quick way to examine the ssh command being used as plumbum doesn't have debug facilities (https://github.com/tomerfiliba/plumbum/issues/474).The key file is accessible and can be read in the same Python script.
The code is basically
with SshMachine('host', user='user', keyfile='./ssh/keyfile') as remote_box:
Environment: Debian 11 Python 3.9.2 OpenSSH 8.4p1 Plumbum 1.7.2