From opensource at ronnypfannschmidt.de Thu Mar 1 12:10:45 2018 From: opensource at ronnypfannschmidt.de (Ronny Pfannschmidt) Date: Thu, 01 Mar 2018 18:10:45 +0100 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> Message-ID: <1519924245.29485.7.camel@ronnypfannschmidt.de> 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 > > From prasanna.mulgaonkar at gmail.com Thu Mar 1 13:19:46 2018 From: prasanna.mulgaonkar at gmail.com (Prasanna Mulgaonkar) Date: Thu, 1 Mar 2018 10:19:46 -0800 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: <1519924245.29485.7.camel@ronnypfannschmidt.de> References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> Message-ID: 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 >> From opensource at ronnypfannschmidt.de Thu Mar 1 15:15:52 2018 From: opensource at ronnypfannschmidt.de (Ronny Pfannschmidt) Date: Thu, 01 Mar 2018 21:15:52 +0100 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> Message-ID: <1519935352.2164.1.camel@ronnypfannschmidt.de> 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 > > From prasanna.mulgaonkar at gmail.com Thu Mar 1 15:21:55 2018 From: prasanna.mulgaonkar at gmail.com (Prasanna Mulgaonkar) Date: Thu, 1 Mar 2018 12:21:55 -0800 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: <1519935352.2164.1.camel@ronnypfannschmidt.de> References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> <1519935352.2164.1.camel@ronnypfannschmidt.de> Message-ID: Hmm. I get a 404 page not found when I click on both those links. But I can look for those lines in the github repo I can get to for execnet. On 03/01/2018 12:15 PM, Ronny Pfannschmidt wrote: > 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 >> From opensource at ronnypfannschmidt.de Thu Mar 1 15:23:43 2018 From: opensource at ronnypfannschmidt.de (Ronny Pfannschmidt) Date: Thu, 01 Mar 2018 21:23:43 +0100 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> <1519935352.2164.1.camel@ronnypfannschmidt.de> Message-ID: <1519935823.2164.3.camel@ronnypfannschmidt.de> im sorry, the links got broken appart into 2 parts by my mail app it should work if you paste them together it was made on current master, so just going for the gateway_io file should be sufficient tho -- Ronny Am Donnerstag, den 01.03.2018, 12:21 -0800 schrieb Prasanna Mulgaonkar: > Hmm. I get a 404 page not found when I click on both those links. But > I > can look for those lines in the github repo I can get to for execnet. > > > On 03/01/2018 12:15 PM, Ronny Pfannschmidt wrote: > > Hi, > > > > https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e > > 481d > > c2a66b208a97/execnet/gateway_io.py#L92-L104 generates the command > > > > https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e > > 481d > > 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 > > From prasanna.mulgaonkar at gmail.com Thu Mar 1 18:43:46 2018 From: prasanna.mulgaonkar at gmail.com (Prasanna Mulgaonkar) Date: Thu, 1 Mar 2018 15:43:46 -0800 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: <1519935823.2164.3.camel@ronnypfannschmidt.de> References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> <1519935352.2164.1.camel@ronnypfannschmidt.de> <1519935823.2164.3.camel@ronnypfannschmidt.de> Message-ID: <990f62f3-c327-0202-5738-157946497659@gmail.com> Thanks Ronny. That worked like a charm. Your help much appreciated. --prasanna On 03/01/2018 12:23 PM, Ronny Pfannschmidt wrote: > im sorry, the links got broken appart into 2 parts by my mail app > it should work if you paste them together > > it was made on current master, so just going for the gateway_io file > should be sufficient tho > > -- Ronny > > Am Donnerstag, den 01.03.2018, 12:21 -0800 schrieb Prasanna Mulgaonkar: >> Hmm. I get a 404 page not found when I click on both those links. But >> I >> can look for those lines in the github repo I can get to for execnet. >> >> >> On 03/01/2018 12:15 PM, Ronny Pfannschmidt wrote: >>> Hi, >>> >>> https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e >>> 481d >>> c2a66b208a97/execnet/gateway_io.py#L92-L104 generates the command >>> >>> https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73ffc2e >>> 481d >>> 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 >> From opensource at ronnypfannschmidt.de Fri Mar 2 01:34:25 2018 From: opensource at ronnypfannschmidt.de (Ronny Pfannschmidt) Date: Fri, 02 Mar 2018 07:34:25 +0100 Subject: [execnet-dev] Urgent question about ssh with username/password In-Reply-To: <990f62f3-c327-0202-5738-157946497659@gmail.com> References: <4438463e-76d1-7a27-e952-e1b500545189@gmail.com> <734b3cc6-dd1b-8a4d-ee91-5368ecfedb91@ronnypfannschmidt.de> <7187c672-671c-b135-58df-34969df3d9b4@gmail.com> <1519924245.29485.7.camel@ronnypfannschmidt.de> <1519935352.2164.1.camel@ronnypfannschmidt.de> <1519935823.2164.3.camel@ronnypfannschmidt.de> <990f62f3-c327-0202-5738-157946497659@gmail.com> Message-ID: <1519972465.2164.5.camel@ronnypfannschmidt.de> lovely - if you like, can you turn it into a option to the ssh tx -- Ronny Am Donnerstag, den 01.03.2018, 15:43 -0800 schrieb Prasanna Mulgaonkar: > Thanks Ronny. That worked like a charm. > > Your help much appreciated. > > --prasanna > > > On 03/01/2018 12:23 PM, Ronny Pfannschmidt wrote: > > im sorry, the links got broken appart into 2 parts by my mail app > > it should work if you paste them together > > > > it was made on current master, so just going for the gateway_io > > file > > should be sufficient tho > > > > -- Ronny > > > > Am Donnerstag, den 01.03.2018, 12:21 -0800 schrieb Prasanna > > Mulgaonkar: > > > Hmm. I get a 404 page not found when I click on both those links. > > > But > > > I > > > can look for those lines in the github repo I can get to for > > > execnet. > > > > > > > > > On 03/01/2018 12:15 PM, Ronny Pfannschmidt wrote: > > > > Hi, > > > > > > > > https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73f > > > > fc2e > > > > 481d > > > > c2a66b208a97/execnet/gateway_io.py#L92-L104 generates the > > > > command > > > > > > > > https://github.com/pytest-dev/execnet/blob/3ea8374724f436a3a73f > > > > fc2e > > > > 481d > > > > 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 > > From arunsep886 at gmail.com Thu Mar 8 06:12:45 2018 From: arunsep886 at gmail.com (arun kali raja) Date: Thu, 8 Mar 2018 16:42:45 +0530 Subject: [execnet-dev] Executing Interactively on remote machines Message-ID: Hi, I bumped upon execnet when i was trying to use pytest-xdist library and was looking if it can used for one of my use case. In my usecase i have some package installed in a remote machine.. I need to run a python session on these remote machines, import the package, create object,etc.. I was thinking if execnet can solve this problem.. I saw that the "remote_exec" method that creates the channel needs the source code that has to be executed . So i have to construct a string with the series of command and then give it to remote_exec. Is there a way to achieve a interactive session using the execnet library? ie., send a command recieve the response given by the command and then send the next command.. (when i first saw execnet usage i thought its like opening a python shell on a remote machine and sending commands to it interactively.). Regards Arun Kaliraja.B -------------- next part -------------- An HTML attachment was scrubbed... URL: From holger at merlinux.eu Thu Mar 8 06:49:15 2018 From: holger at merlinux.eu (holger krekel) Date: Thu, 8 Mar 2018 12:49:15 +0100 Subject: [execnet-dev] Executing Interactively on remote machines In-Reply-To: References: Message-ID: <20180308114915.GF11726@beto> Hi Arun, did you look through the examples here: http://execnet.readthedocs.io/en/latest/examples.html ? I guess if you look through them you'll get an idea of how to use execnet for your purposes. holger > Hi, > > I bumped upon execnet when i was trying to use pytest-xdist library and was > looking if it can used for one of my use case. > > In my usecase i have some package installed in a remote machine.. I need to > run a python session on these remote machines, import the package, create > object,etc.. > > I was thinking if execnet can solve this problem.. > > I saw that the "remote_exec" method that creates the channel needs the > source code that has to be executed . So i have to construct a string with > the series of command and then give it to remote_exec. Is there a way to > achieve a interactive session using the execnet library? ie., send a > command recieve the response given by the command and then send the next > command.. (when i first saw execnet usage i thought its like opening a > python shell on a remote machine and sending commands to it > interactively.). > > Regards > Arun Kaliraja.B > _______________________________________________ > execnet-dev mailing list > execnet-dev at python.org > https://mail.python.org/mailman/listinfo/execnet-dev From arunsep886 at gmail.com Thu Mar 8 07:26:36 2018 From: arunsep886 at gmail.com (arun kali raja) Date: Thu, 8 Mar 2018 17:56:36 +0530 Subject: [execnet-dev] Executing Interactively on remote machines In-Reply-To: <20180308114915.GF11726@beto> References: <20180308114915.GF11726@beto> Message-ID: Hi Holger, Sorry, overlooked the "Working asynchronously/event-based with channels" section in the document at first glance... I think that perfectly solves my problem.. *In [1]: import execnet* *In [2]: gw = execnet.makegateway('ssh=wtllab-spirentdev-1.phaedrus.sandvine.com ')* *In [3]: ch = gw.remote_exec("""* *for item in channel:* * channel.send(eval(item))* *""")* *In [4]: ch.send('os.chdir("/home/dir1")')* *In [5]: ch.receive()* *In [6]: ch.send('os.getcwd()')* *In [7]: ch.send('os.chdir("/home/dir2")')* *In [8]: ch.receive()* *In [9]: ch.send('os.getcwd()')* *In [10]: ch.close()* Thanks a lot :) Regards Arun Kaliraja.B On 8 March 2018 at 17:19, holger krekel wrote: > Hi Arun, > > did you look through the examples here: > > http://execnet.readthedocs.io/en/latest/examples.html > > ? I guess if you look through them you'll get an idea > of how to use execnet for your purposes. > > holger > > > Hi, > > > > I bumped upon execnet when i was trying to use pytest-xdist library and > was > > looking if it can used for one of my use case. > > > > In my usecase i have some package installed in a remote machine.. I need > to > > run a python session on these remote machines, import the package, create > > object,etc.. > > > > I was thinking if execnet can solve this problem.. > > > > I saw that the "remote_exec" method that creates the channel needs the > > source code that has to be executed . So i have to construct a string > with > > the series of command and then give it to remote_exec. Is there a way to > > achieve a interactive session using the execnet library? ie., send a > > command recieve the response given by the command and then send the next > > command.. (when i first saw execnet usage i thought its like opening a > > python shell on a remote machine and sending commands to it > > interactively.). > > > > Regards > > Arun Kaliraja.B > > > _______________________________________________ > > execnet-dev mailing list > > execnet-dev at python.org > > https://mail.python.org/mailman/listinfo/execnet-dev > > -- ????????, ??. ????? ???? ???? -------------- next part -------------- An HTML attachment was scrubbed... URL: