[execnet-dev] Urgent question about ssh with username/password

Ronny Pfannschmidt opensource at ronnypfannschmidt.de
Thu Mar 1 15:15:52 EST 2018


Hi,

https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e481d
c2a66b208a97/execnet/gateway_io.py#L92-L104 generates the command

https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e481d
c2a66b208a97/execnet/gateway_io.py#L123-L136 puts it together with
initializing the server

-- Ronny

Am Donnerstag, den 01.03.2018, 10:19 -0800 schrieb Prasanna Mulgaonkar:
> Ronnie, thanks.
> 
> Somewhere in the guts of the execnet code, you must be issuing the 
> actual ssh command, right? I looked (albeit in a cursory manner) for 
> that location, to see if I could create a local modification that
> would 
> call sshpass instead of ssh directly. Could you point me to where
> that 
> call is made in the code?
> 
> --prasanna
> 
> 
> On 03/01/2018 09:10 AM, Ronny Pfannschmidt wrote:
> > Hi Prasanna,
> > i am sorry for the confusion,
> > i missremembered, ssh has indeed no feature to enter the password
> > that
> > way,
> > execnet also has no feature to enter the password as well
> > 
> > so as things are you are in a blind spot
> > 
> > -- Ronny
> > 
> > 
> > Am Donnerstag, den 22.02.2018, 10:21 -0800 schrieb Prasanna
> > Mulgaonkar:
> > > Ronny, thanks for  your input. I don't understand what you mean
> > > by
> > > the
> > > option //ssh_config=a_file_that_sets_the_password.
> > > 
> > > Is there any documentation on the syntax of that file? For
> > > example,
> > > if
> > > the username is test and password is test (for the sake of
> > > argument),
> > > 
> > > in execnet.makegateway I would provide parameters
> > > "ssh=test at ip//ssh_config=some_file"
> > > 
> > > How do I specify the password itself in the some_file?
> > > 
> > > Everywhere we use execnet, we use it with an identity file and
> > > key-pairs. But in one installation there is something in the
> > > environment
> > > that is preventing key based ssh from working and we are trying
> > > to
> > > debug
> > > this. Even a direct ssh command with keys is being rejected in
> > > the
> > > environment though password based ssh works.
> > > 
> > > Thanks
> > > 
> > > --prasanna
> > > 
> > > 
> > > On 02/21/2018 11:14 PM, RonnyPfannschmidt wrote:
> > > > Hi prasann,
> > > > 
> > > > the common solution is to use a ssh configfile using
> > > > "ssh=...//ssh_config=a_file_that_sets_the_password"
> > > > 
> > > > in general its strongly suggested to set up a identity file and
> > > > use
> > > > that,
> > > > ssh itself has tools to copy the identity files to the host and
> > > > even
> > > > limit the commands it can use
> > > > 
> > > > -- Ronny
> > > > 
> > > > Am 21.02.2018 um 23:26 schrieb Prasanna Mulgaonkar:
> > > > > I know that this is not a recommended approach, but in one
> > > > > particular
> > > > > customer we are working with, only username/password based
> > > > > ssh
> > > > > logins
> > > > > are permitted. How do I open an execnet gateway and pass a
> > > > > password to
> > > > > the ssh call?
> > > > > 
> > > > > For example make_gateway("ssh=testuser at ipaddress") prompts on
> > > > > the
> > > > > python console if I run this in an interactive python shell.
> > > > > I
> > > > > want to
> > > > > run it non interactively. How do I specify the password.
> > > > > 
> > > > > Replacing ssh= with sshpass= does not work.
> > > > > 
> > > > > Thanks
> > > > > 
> > > > > --prasanna
> > > > > 
> > > > > _______________________________________________
> > > > > execnet-dev mailing list
> > > > > execnet-dev at python.org
> > > > > https://mail.python.org/mailman/listinfo/execnet-dev
> 
> 


More information about the execnet-dev mailing list