<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msochpdefault, li.msochpdefault, div.msochpdefault
{mso-style-name:msochpdefault;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Calibri","sans-serif";}
span.emailstyle17
{mso-style-name:emailstyle17;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Hi Neil,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I did the same as you have suggested. I have created an instance A and generated a private_key, giving it 600 permission. Using the key I launched the instance B but when I ssh from the instance A after a while it reads:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Read from socket failed: Connection timed out<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I even tried with ssh –v hostname to test on one the machine outside openstack and the instance.<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">root@new:/home/ubuntu# ssh -v new<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Reading configuration data /etc/ssh/ssh_config<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: /etc/ssh/ssh_config line 19: Applying options for *<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Connecting to new [10.x.x.x] port 22.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Connection established.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: permanently_set_uid: 0/0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_rsa type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_rsa-cert type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_dsa type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_dsa-cert type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_ecdsa type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_ecdsa-cert type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_ed25519 type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: identity file /root/.ssh/id_ed25519-cert type -1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Enabling compatibility mode for protocol 2.0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">debug1: SSH2_MSG_KEXINIT sent<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal">Read from socket failed: Connection timed out<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">So this is what I’m getting again.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">Aishwarya<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Neil Jerram [mailto:Neil.Jerram@metaswitch.com]
<br>
<b>Sent:</b> Thursday, July 30, 2015 1:38 PM<br>
<b>To:</b> Adyanthaya, Aishwarya; openstack-operators@lists.openstack.org<br>
<b>Subject:</b> Re: [Openstack-operators] ssh inside instance<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">Hi Aishwarya, <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">The basic requirement here is that anyone - which really means a combination of a computer or instance, plus a user on that computer/instance - needs to have the private key that matches
the public key that is installed on the target instance. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">You've asked about logging in from your first instance - let's call it A - so you need to save the private key in a file on A - let's call it private_key - and give it 600 permissions:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"> chmod 600 private_key<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">Then you can use this key with SSH like this:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"> ssh -i private_key USER@OTHER-INSTANCE<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">Hope that helps. <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D">Regards, <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"> Neil <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:#1F497D"><o:p> </o:p></span></p>
</div>
<table class="MsoNormalTable" border="0" cellpadding="0" width="100%" style="width:100.0%;background:white;border-spacing:0px">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt;font-size:initial;text-align:initial">
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:
</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><a href="mailto:aishwarya.adyanthaya@accenture.com">aishwarya.adyanthaya@accenture.com</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Sent:
</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Thursday, 30 July 2015 05:24<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">To:
</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><a href="mailto:openstack-operators@lists.openstack.org">openstack-operators@lists.openstack.org</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Subject:
</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">[Openstack-operators] ssh inside instance<o:p></o:p></span></p>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
<div id="_originalContent">
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I’ve launched two instances from my openstack dashboard. Firstly I created instance one, where I generated a key through the ssh-keygen command, pasting the public key contents to import key in the access and security. Using this key I
launched second instance.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I want to be able to ssh the second instance from my first instance. Could someone tell me how to work it out?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">Aishwarya Adyanthaya<o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;font-family:"Times New Roman","serif"">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray"><br>
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by
you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of
internal compliance with Accenture policy. <br>
______________________________________________________________________________________<br>
<br>
<a href="http://www.accenture.com">www.accenture.com</a><br>
</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
</div>
</body>
</html>