Re: ssh without password is not working correctly
ShibuThomas <[email protected]> Wed, 29 Jun 2011 17:31:54 +0530
| Newsgroups | gmane.linux.redhat.install |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format. --===============6489091740565079404== Content-Type: multipart/alternative; boundary="------------070109050602020204040500" This is a multi-part message in MIME format. --------------070109050602020204040500 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; format="flowed" Hi Nigel, Yes, you are right. I done as such you mentioned.Its working now Thanks. Regards ShibuThomas Nigel Wade wrote: > On 29/06/11 11:46, ShibuThomas wrote: > =20 >> HI all. >> >> I want to do ssh login into two different mechines on by one.I tried the >> following squence.but it is not working correctly. >> For Ex I have 3 mechines Host1,Host2,Host3. >> I need to login into Host2,Host3 using SSH from Host1. >> I tried the following: >> step 1: >> -logged into Host 1 >> -execute ssh localhost >> =20 > Why, you are already logged into host1? > > =20 >> -execute ssh-keygen -t dsa >> -execute scp ~/.ssh/id_dsa.pub Host2:.ssh/authorized_keys2 >> -exectue ssh -l root Host2 >> not get the prompt for password. >> =20 > > Ok, so now you have a private key on host1, and the corresponding public > key on host2. > > =20 >> Then I tried to connect to Host3 >> step 2: >> -logged into Host 1 >> -execute ssh localhost >> -execute ssh-keygen -t dsa >> =20 > > You just created a new public/private key pair, overwriting the keys you > previously created (which you need to logon to host2). > > =20 >> -execute scp ~/.ssh/id_dsa.pub Host3:.ssh/authorized_keys2 >> -execute ssh -l root Host3 >> not get the prompt for password. >> =20 > > Ok, so using the new public/private key works for host3. > > =20 >> But after this I tried to connect Host2 from Host1 using >> -ssh -l root Host2 >> I got the prompt for enetring pasword. >> =20 > > Because you overwrote the private key on host1 which is needed to > connect to host2 using the public key on host2. > > =20 >> Is anyone know how to rectify this. >> >> =20 > > Copy the new public key to host2 > > =20 >> -log into Host 1 >> -execute scp ~/.ssh/id_dsa.pub Host2:.ssh/authorized_keys2 >> =20 > > All you needed to do at step 2 was copy the same public key to host3, > just as you had already done for host2. > > =20 --------------070109050602020204040500 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="iso-8859-1" <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content=3D"text/html;charset=3DISO-8859-1" http-equiv=3D"Content-Ty= pe"> </head> <body bgcolor=3D"#ffffff" text=3D"#000000"> Hi Nigel,<br> <br> Yes, you are right.<br> I done as such you mentioned.Its working now<br> Thanks.<br> <br> Regards<br> ShibuThomas<br> <br> <br> Nigel Wade wrote: <blockquote cite=3D"mid:[email protected]" type=3D"cite"> <pre wrap=3D"">On 29/06/11 11:46, ShibuThomas wrote: </pre> <blockquote type=3D"cite"> <pre wrap=3D"">HI all. I want to do ssh login into two different mechines on by one.I tried the following squence.but it is not working correctly. For Ex I have 3 mechines Host1,Host2,Host3. I need to login into Host2,Host3 using SSH from Host1. I tried the following: step 1: -logged into Host 1 -execute ssh localhost </pre> </blockquote> <pre wrap=3D""><!---->Why, you are already logged into host1? </pre> <blockquote type=3D"cite"> <pre wrap=3D"">-execute ssh-keygen -t dsa -execute scp ~/.ssh/id_dsa.pub Host2:.ssh/authorized_keys2 -exectue ssh -l root Host2 not get the prompt for password. </pre> </blockquote> <pre wrap=3D""><!----> Ok, so now you have a private key on host1, and the corresponding public key on host2. </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Then I tried to connect to Host3 step 2: -logged into Host 1 -execute ssh localhost -execute ssh-keygen -t dsa </pre> </blockquote> <pre wrap=3D""><!----> You just created a new public/private key pair, overwriting the keys you previously created (which you need to logon to host2). </pre> <blockquote type=3D"cite"> <pre wrap=3D"">-execute scp ~/.ssh/id_dsa.pub Host3:.ssh/authorized_key= s2 -execute ssh -l root Host3 not get the prompt for password. </pre> </blockquote> <pre wrap=3D""><!----> Ok, so using the new public/private key works for host3. </pre> <blockquote type=3D"cite"> <pre wrap=3D"">But after this I tried to connect Host2 from Host1 using -ssh -l root Host2 I got the prompt for enetring pasword. </pre> </blockquote> <pre wrap=3D""><!----> Because you overwrote the private key on host1 which is needed to connect to host2 using the public key on host2. </pre> <blockquote type=3D"cite"> <pre wrap=3D"">Is anyone know how to rectify this. </pre> </blockquote> <pre wrap=3D""><!----> Copy the new public key to host2 </pre> <blockquote type=3D"cite"> <pre wrap=3D"">-log into Host 1 -execute scp ~/.ssh/id_dsa.pub Host2:.ssh/authorized_keys2 </pre> </blockquote> <pre wrap=3D""><!----> All you needed to do at step 2 was copy the same public key to host3, just as you had already done for host2. </pre> </blockquote> <br> <font face=3D"monospace"></font></body> </html> --------------070109050602020204040500-- --===============6489091740565079404== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Redhat-install-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/redhat-install-list To Unsubscribe Go To ABOVE URL or send a message to: [email protected] Subject: unsubscribe --===============6489091740565079404==--