[paramiko] (no subject)
Dony Pierre
Pierre.Dony at nbb.be
Thu Mar 8 23:45:15 PST 2007
Hi all,
I use SSHClient to execute a command on a SAN switch :
client = SSHClient()
client.load_system_host_keys()
client.connect(hostname,username=username,password=password)
stdin, stdout, stderr = client.exec_command(cmd)
The switch doesn't accept an authentication by key so it closes the
connection directly in case of a try with authentication by key. I have
to use directly an authentication by password. In the Linux ssh command,
the option -o PrefferedAuthentications=password let you change the
default option for authentications and force the first try to password.
How can I do the same with SSHClient. In the doc, I see for SSHClient :
Authentication is attempted in the following order of priority:
The pkey or key_filename passed in (if any)
Any key we can find through an SSH agent
Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/
Plain username/password auth, if a password was given
How can I put "Plain username/password auth, if a password was given" to
the first try ?
Thanks a lot for your help.
Regards.
Pierre.
-----------------------------------------
Visit our website! http://www.nbb.be
"DISCLAIMER: The content of this e-mail message should not be
construed as binding on the part of the National Bank of Belgium
(NBB) unless otherwise and previously stated. The opinions
expressed in this message are solely those of the author and do not
necessarily reflect NBB viewpoints, particularly when the content
of this message, or part thereof, is private by nature or does not
fall within the professional scope of its author."
More information about the paramiko
mailing list