From: MAGANA, A. S I C. U. A. 72 ABW/S. <and...@us...> - 2015-03-31 18:13:39
|
My script is not updating my password on the remote Solaris server and I am a novice. [root@52wwyk-as-1405 amagana]# perl -w ./tester-a Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', 'Password:\x{a}') called at ./tester-a line 8 Argument "Password:\n" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', '$') called at ./tester-a line 10 Argument "$" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. mycurrentpassword Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', 'Password:') called at ./tester-a line 12 Argument "Password:" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. su - root Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', '#') called at ./tester-a line 14 Argument "#" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. myrootpassword Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', 'New Password:\x{a}') called at ./tester-a line 16 Argument "New Password:\n" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. passwd amagana Starting EXPECT pattern matching... at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f98a3a0)', 'Re-enter new Password:\x{a}') called at ./tester-a line 18 Argument "Re-enter new Password:\n" isn't numeric in subtraction (-) at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 641. mynewpassword Closing spawn id(3). at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 1431 Expect::hard_close('Expect=GLOB(0x1f98a3a0)') called at /usr/lib/perl5/site_perl/5.8.8/Expect.pm line 1621 Expect::DESTROY('Expect=GLOB(0x1f98a3a0)') called at ./tester-a line 0 eval {...} called at ./tester-a line 0 spawn id(3) closed. Pid 1385 of spawn id(3) terminated, Status: 0x01 [root@52wwyk-as-1405 amagana]# //SIGNED// Andy Magaña UNIX Systems Administrator Diligent Contractor, 72nd Air Base Wing Tinker Air Force Base, Oklahoma Commercial: (405) 734-0341 -----Original Message----- From: exp...@li... [mailto:exp...@li...] Sent: Tuesday, March 31, 2015 11:30 AM To: exp...@li... Subject: Expectperl-discuss Digest, Vol 45, Issue 5 Send Expectperl-discuss mailing list submissions to exp...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/expectperl-discuss or, via email, send a message with subject or body 'help' to exp...@li... You can reach the person managing the list at exp...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of Expectperl-discuss digest..." Today's Topics: 1. Re: expect.pm script (MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT) 2. expect.pm not updating password (MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT) 3. Re: expect.pm not updating password (ESRY JR., DON) ---------------------------------------------------------------------- Message: 1 Date: Fri, 27 Mar 2015 21:49:10 +0000 From: "MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT" <and...@us...> Subject: Re: [Expectperl-discuss] expect.pm script To: Salvador Fandino <sfa...@ya...>, "exp...@li..." <exp...@li...> Message-ID: <6AB...@52...> Content-Type: text/plain; charset="utf-8" I ran this script "parallel_passwd.pl" from a linux box and I wanted to change my password on a solaris 10 server but after I enter the old password and new password I get nothing back, not even a timeout or error. I run the perl script like this: perl ./parallel_passwd.pl -l myloginname remoteserver //SIGNED// Andy Maga?a UNIX Systems Administrator Diligent Contractor, 72nd Air Base Wing Tinker Air Force Base, Oklahoma Commercial: (405) 734-0341 -----Original Message----- From: Salvador Fandino [mailto:sfa...@ya...] Sent: Friday, March 27, 2015 9:59 AM To: MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT; exp...@li... Subject: Re: [Expectperl-discuss] expect.pm script ----- Original Message ----- > From: "MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT" > <and...@us...> > To: Salvador Fandino <sfa...@ya...>; > "exp...@li..." > <exp...@li...> > Cc: > Sent: Friday, March 27, 2015 3:38 PM > Subject: RE: [Expectperl-discuss] expect.pm script > > Salvador, > > This change_passwd.pl script looks like what I need can you help me > modify it to be a usable script? You may nned to change the regular expresions passed to the answer_passwd sub to match the prompt used in the target systems. Otherwise, the script works as is. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3357 bytes Desc: not available ------------------------------ Message: 2 Date: Tue, 31 Mar 2015 16:01:20 +0000 From: "MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT" <and...@us...> Subject: [Expectperl-discuss] expect.pm not updating password To: "exp...@li..." <exp...@li...> Message-ID: <6AB...@52...> Content-Type: text/plain; charset="iso-8859-1" I am a novice and have a expect.pm script that is supposed to ssh to remote host and change my password on a Sparc Solaris 10 server. #!/usr/bin/perl use strict; use Expect; my $ssh = Expect->new('ssh mylogin@remotehost'); $ssh->debug(0); $ssh->expect("Password:\n"); $ssh->send("mycurrentpassword\n"); $ssh->expect('$'); $ssh->send("su - root\n"); $ssh->expect("Password:"); $ssh->send("myrootpassword\n"); $ssh->expect('#'); $ssh->send("passwd mylogin\n"); $ssh->expect("New Password:\n"); $ssh->send("mynewpassword\n"); $ssh->expect("Re-enter new Password:\n"); $ssh->send("mynewpassword\n"); #$ssh->expect #$ssh->close(); //SIGNED// Andy Maga?a UNIX Systems Administrator Diligent Contractor, 72nd Air Base Wing Tinker Air Force Base, Oklahoma Commercial: (405) 734-0341 -----Original Message----- From: openssl-users [mailto:ope...@op...] On Behalf Of ope...@op... Sent: Wednesday, March 18, 2015 12:36 PM To: ope...@op... Subject: openssl-users Digest, Vol 4, Issue 23 Send openssl-users mailing list submissions to ope...@op... To subscribe or unsubscribe via the World Wide Web, visit https://mta.openssl.org/mailman/listinfo/openssl-users or, via email, send a message with subject or body 'help' to ope...@op... You can reach the person managing the list at ope...@op... When replying, please edit your Subject line so it is more specific than "Re: Contents of openssl-users digest..." Today's Topics: 1. Re: base64 decode in C (Jakob Bohm) 2. Re: base64 decode in C (Walter H.) 3. Re: [openssl-announce] Forthcoming OpenSSL releases (Dr. Matthias St. Pierre) 4. Re: base64 decode in C (Scott Neugroschl) ---------------------------------------------------------------------- Message: 1 Date: Wed, 18 Mar 2015 17:33:41 +0100 From: Jakob Bohm <jb-...@wi...> To: ope...@op... Subject: Re: [openssl-users] base64 decode in C Message-ID: <550...@wi...> Content-Type: text/plain; charset=windows-1252; format=flowed Please refer to Dave Thompson's answer, it describes your problem. On 18/03/2015 16:08, Prashant Bapat wrote: > Hi Dave and Walter, > > Thanks for our reply. > > I'm not doing anything different for the ssh pubkey. I'm able to > decode it using the "openssl enc -base64 -d -A" command. But not using > the C program. > > Attaching my entire code here. After getting the base64 decoded I'm > calculating the MD5 sum and printing it. This works for a regular > string but not for SSH pubkey. > > Thanks again. > > --Prashant > Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com Transformervej 29, 2860 S?borg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded ------------------------------ Message: 2 Date: Wed, 18 Mar 2015 17:40:06 +0100 From: "Walter H." <Wal...@ma...> To: ope...@op... Subject: Re: [openssl-users] base64 decode in C Message-ID: <550...@ma...> Content-Type: text/plain; charset="utf-8"; Format="flowed" On 18.03.2015 16:08, Prashant Bapat wrote: > printf("Base64 decoded string is : %s\n", b64_decode(str, strlen(str))); // This should print binary for a ssh key. not really, because the return of b64_decode is not a C string; and the format specfier %s expects a C string; -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5971 bytes Desc: S/MIME Cryptographic Signature URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150318/f066e41 6/attachment-0001.bin> ------------------------------ Message: 3 Date: Wed, 18 Mar 2015 17:59:59 +0100 From: "Dr. Matthias St. Pierre" <Mat...@nc...> To: <ope...@op...> Subject: Re: [openssl-users] [openssl-announce] Forthcoming OpenSSL releases Message-ID: <550...@nc...> Content-Type: text/plain; charset="windows-1252" Thanks for the three line upgracde recipe in https://wiki.openssl.org/index.php/Code_reformatting It's as simple as you stated, indeed. The reformatting was a good thing to do. Also, it makes sense to me to apply it to all stable branches uniformly, in order to simplify cross-branch merging. msp On 03/18/2015 04:32 PM, Salz, Rich wrote: >> The extra work is also documented (in a place not linked from the wiki) for >> those who maintain a git fork of the OpenSSL repository. > > I just tossed together https://wiki.openssl.org/index.php/Code_reformatting > Found off the main page, https://wiki.openssl.org/index.php/Main_Page#Internals_and_Development > >> But I have not yet seen a meaningful recipe for those of us who maintain a >> traditional set of feature patches against the released tarballs, nicely >> organized for future contribution. > > Folks had months of warning that this was going to happen. And, frankly, patches did not come flooding into the team. > > But I hope the above link helps. > > /r$ > > _______________________________________________ > openssl-users mailing list > To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users > ------------------------------ Message: 4 Date: Wed, 18 Mar 2015 17:26:39 +0000 From: Scott Neugroschl <sc...@xy...> To: "ope...@op..." <ope...@op...> Subject: Re: [openssl-users] base64 decode in C Message-ID: <D358E5B1511A314F8160ADC6F3754987069FD9F8@XYSVEX01.XYPRO-23.LOCAL> Content-Type: text/plain; charset="utf-8" I believe the SSH pubkey is binary data, not ASCII, so strlen() will not work on it if it has embedded NUL chars. As Dave Thompson suggested, instead of strlen(), use the length returned from BIO_read. From: openssl-users [mailto:ope...@op...] On Behalf Of Prashant Bapat Sent: Wednesday, March 18, 2015 8:08 AM To: openssl-users Subject: Re: [openssl-users] base64 decode in C Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" command. But not using the C program. Attaching my entire code here. After getting the base64 decoded I'm calculating the MD5 sum and printing it. This works for a regular string but not for SSH pubkey. Thanks again. --Prashant On 18 March 2015 at 18:04, Walter H. <Wal...@ma...<mailto:Wal...@ma...>> wrote: Hi, before calling this function, remove any whitespace; Walter _______________________________________________ openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150318/a6cff62 3/attachment.html> ------------------------------ Subject: Digest Footer _______________________________________________ openssl-users mailing list ope...@op... https://mta.openssl.org/mailman/listinfo/openssl-users ------------------------------ End of openssl-users Digest, Vol 4, Issue 23 ******************************************** -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3357 bytes Desc: not available ------------------------------ Message: 3 Date: Tue, 31 Mar 2015 16:15:12 +0000 From: "ESRY JR., DON" <de...@at...> Subject: Re: [Expectperl-discuss] expect.pm not updating password To: "MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT" <and...@us...>, "exp...@li..." <exp...@li...> Message-ID: <4AC...@GA...> Content-Type: text/plain; charset="iso-8859-1" I don't see a question in your email. What do you see on your screen when you run it? -----Original Message----- From: MAGANA, ANDREAS S I CTR USAF AFMC 72 ABW/SCOOT [mailto:and...@us...] Sent: Tuesday, March 31, 2015 12:01 PM To: exp...@li... Subject: [Expectperl-discuss] expect.pm not updating password I am a novice and have a expect.pm script that is supposed to ssh to remote host and change my password on a Sparc Solaris 10 server. #!/usr/bin/perl use strict; use Expect; my $ssh = Expect->new('ssh mylogin@remotehost'); $ssh->debug(0); $ssh->expect("Password:\n"); $ssh->send("mycurrentpassword\n"); $ssh->expect('$'); $ssh->send("su - root\n"); $ssh->expect("Password:"); $ssh->send("myrootpassword\n"); $ssh->expect('#'); $ssh->send("passwd mylogin\n"); $ssh->expect("New Password:\n"); $ssh->send("mynewpassword\n"); $ssh->expect("Re-enter new Password:\n"); $ssh->send("mynewpassword\n"); #$ssh->expect #$ssh->close(); //SIGNED// Andy Maga?a UNIX Systems Administrator Diligent Contractor, 72nd Air Base Wing Tinker Air Force Base, Oklahoma Commercial: (405) 734-0341 -----Original Message----- From: openssl-users [mailto:ope...@op...] On Behalf Of ope...@op... Sent: Wednesday, March 18, 2015 12:36 PM To: ope...@op... Subject: openssl-users Digest, Vol 4, Issue 23 Send openssl-users mailing list submissions to ope...@op... To subscribe or unsubscribe via the World Wide Web, visit https://mta.openssl.org/mailman/listinfo/openssl-users or, via email, send a message with subject or body 'help' to ope...@op... You can reach the person managing the list at ope...@op... When replying, please edit your Subject line so it is more specific than "Re: Contents of openssl-users digest..." Today's Topics: 1. Re: base64 decode in C (Jakob Bohm) 2. Re: base64 decode in C (Walter H.) 3. Re: [openssl-announce] Forthcoming OpenSSL releases (Dr. Matthias St. Pierre) 4. Re: base64 decode in C (Scott Neugroschl) ---------------------------------------------------------------------- Message: 1 Date: Wed, 18 Mar 2015 17:33:41 +0100 From: Jakob Bohm <jb-...@wi...> To: ope...@op... Subject: Re: [openssl-users] base64 decode in C Message-ID: <550...@wi...> Content-Type: text/plain; charset=windows-1252; format=flowed Please refer to Dave Thompson's answer, it describes your problem. On 18/03/2015 16:08, Prashant Bapat wrote: > Hi Dave and Walter, > > Thanks for our reply. > > I'm not doing anything different for the ssh pubkey. I'm able to > decode it using the "openssl enc -base64 -d -A" command. But not using > the C program. > > Attaching my entire code here. After getting the base64 decoded I'm > calculating the MD5 sum and printing it. This works for a regular > string but not for SSH pubkey. > > Thanks again. > > --Prashant > Enjoy Jakob -- Jakob Bohm, CIO, Partner, WiseMo A/S. http://www.wisemo.com Transformervej 29, 2860 S?borg, Denmark. Direct +45 31 13 16 10 This public discussion message is non-binding and may contain errors. WiseMo - Remote Service Management for PCs, Phones and Embedded ------------------------------ Message: 2 Date: Wed, 18 Mar 2015 17:40:06 +0100 From: "Walter H." <Wal...@ma...> To: ope...@op... Subject: Re: [openssl-users] base64 decode in C Message-ID: <550...@ma...> Content-Type: text/plain; charset="utf-8"; Format="flowed" On 18.03.2015 16:08, Prashant Bapat wrote: > printf("Base64 decoded string is : %s\n", b64_decode(str, strlen(str))); // This should print binary for a ssh key. not really, because the return of b64_decode is not a C string; and the format specfier %s expects a C string; -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5971 bytes Desc: S/MIME Cryptographic Signature URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150318/f066e41 6/attachment-0001.bin> ------------------------------ Message: 3 Date: Wed, 18 Mar 2015 17:59:59 +0100 From: "Dr. Matthias St. Pierre" <Mat...@nc...> To: <ope...@op...> Subject: Re: [openssl-users] [openssl-announce] Forthcoming OpenSSL releases Message-ID: <550...@nc...> Content-Type: text/plain; charset="windows-1252" Thanks for the three line upgracde recipe in https://wiki.openssl.org/index.php/Code_reformatting It's as simple as you stated, indeed. The reformatting was a good thing to do. Also, it makes sense to me to apply it to all stable branches uniformly, in order to simplify cross-branch merging. msp On 03/18/2015 04:32 PM, Salz, Rich wrote: >> The extra work is also documented (in a place not linked from the wiki) for >> those who maintain a git fork of the OpenSSL repository. > > I just tossed together https://wiki.openssl.org/index.php/Code_reformatting > Found off the main page, https://wiki.openssl.org/index.php/Main_Page#Internals_and_Development > >> But I have not yet seen a meaningful recipe for those of us who maintain a >> traditional set of feature patches against the released tarballs, nicely >> organized for future contribution. > > Folks had months of warning that this was going to happen. And, frankly, patches did not come flooding into the team. > > But I hope the above link helps. > > /r$ > > _______________________________________________ > openssl-users mailing list > To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users > ------------------------------ Message: 4 Date: Wed, 18 Mar 2015 17:26:39 +0000 From: Scott Neugroschl <sc...@xy...> To: "ope...@op..." <ope...@op...> Subject: Re: [openssl-users] base64 decode in C Message-ID: <D358E5B1511A314F8160ADC6F3754987069FD9F8@XYSVEX01.XYPRO-23.LOCAL> Content-Type: text/plain; charset="utf-8" I believe the SSH pubkey is binary data, not ASCII, so strlen() will not work on it if it has embedded NUL chars. As Dave Thompson suggested, instead of strlen(), use the length returned from BIO_read. From: openssl-users [mailto:ope...@op...] On Behalf Of Prashant Bapat Sent: Wednesday, March 18, 2015 8:08 AM To: openssl-users Subject: Re: [openssl-users] base64 decode in C Hi Dave and Walter, Thanks for our reply. I'm not doing anything different for the ssh pubkey. I'm able to decode it using the "openssl enc -base64 -d -A" command. But not using the C program. Attaching my entire code here. After getting the base64 decoded I'm calculating the MD5 sum and printing it. This works for a regular string but not for SSH pubkey. Thanks again. --Prashant On 18 March 2015 at 18:04, Walter H. <Wal...@ma...<mailto:Wal...@ma...>> wrote: Hi, before calling this function, remove any whitespace; Walter _______________________________________________ openssl-users mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150318/a6cff62 3/attachment.html> ------------------------------ Subject: Digest Footer _______________________________________________ openssl-users mailing list ope...@op... https://mta.openssl.org/mailman/listinfo/openssl-users ------------------------------ End of openssl-users Digest, Vol 4, Issue 23 ******************************************** ------------------------------ ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ ------------------------------ _______________________________________________ Expectperl-discuss mailing list Exp...@li... https://lists.sourceforge.net/lists/listinfo/expectperl-discuss End of Expectperl-discuss Digest, Vol 45, Issue 5 ************************************************* |