Based on docstring this method accepting the following parameters:
Docstring: Session.userauth_publickey_fromfile(self, username, privatekey, passphrase='', publickey=None) Authenticate with public key from file.
But official project description has this example:
session.userauth_publickey_fromfile( username, 'my_pkey.pub', 'my_pkey', '')
So in this example the second parameter is a public key, but the docstring says it has to be a private key.
Also there are 2 positional arguments in docstring but 4 in the given example.
So what is the correct combination of parameters?
Thanks in advance.
P.S. Moreover it is not clear which format should be the privatekey and the publickey presented in. Should it be like a path to the files or bytes? If it is in bytes, then why the whole function called "_fromfile"? Very confusing.
Question: it is not clear which format should be the
privatekeyand thepublickey
Source on GitHub tells:
def userauth_publickey_fromfile(self, username not None, privatekey not None, passphrase='', publickey=None):
From the Documentation, only for publickey, the types explained.
For security reasons, a Private Key should never stored inside a python script.
You have to read it from a access restriced file storage.
You are right, the Parameters should be explained as in userauth_publickey(...).
Documentation userauth_publickey...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With