Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyfile is ignored by SshMachine #602

Closed
youk opened this issue Jun 11, 2022 · 2 comments
Closed

keyfile is ignored by SshMachine #602

youk opened this issue Jun 11, 2022 · 2 comments

Comments

@youk
Copy link

youk commented Jun 11, 2022

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 (#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

@youk
Copy link
Author

youk commented Feb 5, 2023

The issue is present in 1.8.1 as well.

@youk
Copy link
Author

youk commented Dec 12, 2023

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.

@youk youk closed this as completed Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant