<div dir="ltr">upon further investigation (with the tripple-v output) i see the difference is that on my host machine, ssh is attempts to try several (wrong) keys before finally trying my correct key.  the correct key is marked as "explicit" but there are too many authentication failures before the correct one can be tried, and the server closes connection.<div><br></div><div>that seems really dumb, though, because why would ssh try all these keys before getting to the one i've specified?</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>++++++++++++++++++++++++++</div><div>Research Fellow, Head of Metadata</div><div><a href="https://guardianproject.info" target="_blank">The Guardian Project</a></div><div><br></div>pgp: 0x0A0F0B18<br>twitter: @harlo</div></div></div>
<br><div class="gmail_quote">On Wed, Nov 5, 2014 at 10:39 AM, Harlo Holmes <span dir="ltr"><<a href="mailto:harlo@guardianproject.info" target="_blank">harlo@guardianproject.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Having a problem.  It seems so pathetic to me, I'm slightly embarrassed to ask it.  But here goes...</div><div><br></div><div>As of yesterday, I've had trouble ssh-ing into some amazon instances.  I have an alias on my host machine that does this:</div><div><br></div><div>ssh -i /path/to/private/key user@host</div><div><br></div><div>This has always worked, as it should.  The private key has not changed; not one thing has changed.  But it stopped working.</div><div><br></div><div>At first, I freaked out, thinking someone accessed my instance, and wiped out the contents of ~/.ssh/authorized_keys, and that scared me.  But turns out, that's not the case.  On a virtual machine, i am able to ssh into the instance fine using the same command.</div><div><br></div><div>Here's the output of that command with the debug flag on my virtual machine (which succeeded):</div><div><br></div><div><div>ash-vb@ash-vb:~$ ssh -i j3m_info/unveillance_proxy_NEW.pem <a href="mailto:ubuntu@ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ubuntu@ec2-54-224-53-141.compute-1.amazonaws.com</a> -v</div><div>OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014</div><div>debug1: Reading configuration data /home/ash-vb/.ssh/config</div><div>debug1: Reading configuration data /etc/ssh/ssh_config</div><div>debug1: /etc/ssh/ssh_config line 19: Applying options for *</div><div>debug1: Connecting to <a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a> [54.224.53.141] port 22.</div><div>debug1: Connection established.</div><div>debug1: identity file j3m_info/unveillance_proxy_NEW.pem type -1</div><div>debug1: identity file j3m_info/unveillance_proxy_NEW.pem-cert type -1</div><div>debug1: Enabling compatibility mode for protocol 2.0</div><div>debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2</div><div>debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4</div><div>debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH_5* compat 0x0c000000</div><div>debug1: SSH2_MSG_KEXINIT sent</div><div>debug1: SSH2_MSG_KEXINIT received</div><div>debug1: kex: server->client aes128-ctr hmac-md5 none</div><div>debug1: kex: client->server aes128-ctr hmac-md5 none</div><div>debug1: sending SSH2_MSG_KEX_ECDH_INIT</div><div>debug1: expecting SSH2_MSG_KEX_ECDH_REPLY</div><div>debug1: Server host key: ECDSA 97:4e:ff:55:c4:19:7e:23:2d:0d:c4:4d:59:17:3f:44</div><div>debug1: Host '<a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a>' is known and matches the ECDSA host key.</div><div>debug1: Found key in /home/ash-vb/.ssh/known_hosts:9</div><div>debug1: ssh_ecdsa_verify: signature correct</div><div>debug1: SSH2_MSG_NEWKEYS sent</div><div>debug1: expecting SSH2_MSG_NEWKEYS</div><div>debug1: SSH2_MSG_NEWKEYS received</div><div>debug1: Roaming not allowed by server</div><div>debug1: SSH2_MSG_SERVICE_REQUEST sent</div><div>debug1: SSH2_MSG_SERVICE_ACCEPT received</div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Next authentication method: publickey</div><div><b>debug1: Trying private key: j3m_info/unveillance_proxy_NEW.pem</b></div><div>debug1: key_parse_private2: missing begin marker</div><div>debug1: read PEM private key done: type RSA</div><div>debug1: Authentication succeeded (publickey).</div><div>Authenticated to <a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a> ([54.224.53.141]:22).</div><div>debug1: channel 0: new [client-session]</div><div>debug1: Requesting <a href="mailto:no-more-sessions@openssh.com" target="_blank">no-more-sessions@openssh.com</a></div><div>debug1: Entering interactive session.</div><div>debug1: Sending environment.</div><div>debug1: Sending env LANG = en_US.UTF-8</div><div>Welcome to Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-54-virtual x86_64)</div></div><div><br></div><div>and here's the output on my host (which fails now):</div><div><br></div><div><div>~ $ ssh <a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a> -vOpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014</div><div>debug1: Reading configuration data /home/videoclash/.ssh/config</div><div>debug1: /home/videoclash/.ssh/config line 5: Applying options for <a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a></div><div>debug1: Reading configuration data /etc/ssh/ssh_config</div><div>debug1: /etc/ssh/ssh_config line 19: Applying options for *</div><div>debug1: Connecting to <a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a> [54.224.53.141] port 22.</div><div>debug1: Connection established.</div><div>debug1: identity file /media/videoclash/video_one/keybase/ec2/unveillance_proxy_NEW.pem type -1</div><div>debug1: identity file /media/videoclash/video_one/keybase/ec2/unveillance_proxy_NEW.pem-cert type -1</div><div>debug1: Enabling compatibility mode for protocol 2.0</div><div>debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2</div><div>debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4</div><div>debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH_5* compat 0x0c000000</div><div>debug1: SSH2_MSG_KEXINIT sent</div><div>debug1: SSH2_MSG_KEXINIT received</div><div>debug1: kex: server->client aes128-ctr hmac-md5 none</div><div>debug1: kex: client->server aes128-ctr hmac-md5 none</div><div>debug1: sending SSH2_MSG_KEX_ECDH_INIT</div><div>debug1: expecting SSH2_MSG_KEX_ECDH_REPLY</div><div>debug1: Server host key: ECDSA 97:4e:ff:55:c4:19:7e:23:2d:0d:c4:4d:59:17:3f:44</div><div>debug1: Host '<a href="http://ec2-54-224-53-141.compute-1.amazonaws.com" target="_blank">ec2-54-224-53-141.compute-1.amazonaws.com</a>' is known and matches the ECDSA host key.</div><div>debug1: Found key in /home/videoclash/.ssh/known_hosts:28</div><div>debug1: ssh_ecdsa_verify: signature correct</div><div>debug1: SSH2_MSG_NEWKEYS sent</div><div>debug1: expecting SSH2_MSG_NEWKEYS</div><div>debug1: SSH2_MSG_NEWKEYS received</div><div>debug1: Roaming not allowed by server</div><div>debug1: SSH2_MSG_SERVICE_REQUEST sent</div><div>debug1: SSH2_MSG_SERVICE_ACCEPT received</div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Next authentication method: publickey</div><div><b>debug1: Offering RSA public key: videoclash@VIDEOClash</b></div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Offering RSA public key: <a href="mailto:harlo.holmes@gmail.com" target="_blank">harlo.holmes@gmail.com</a></div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Offering RSA public key: videoclash@VIDEOClash</div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Offering RSA public key: videoclash@VIDEOClash</div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Offering RSA public key: videoclash@VIDEO</div><div>debug1: Authentications that can continue: publickey</div><div>debug1: Offering RSA public key: videoclash@VIDEOClash</div><div>Received disconnect from <a href="http://54.224.53.141" target="_blank">54.224.53.141</a>: 2: Too many authentication failures for ubuntu</div></div><div><br></div><div>From the logs (which i've set in bold), it appears that ssh is absolutely ignoring the keyfile, even though i've explicitly set the -i flag.  I also modified my ~/.ssh/config file to set it there, but that does not work either.</div><div><br></div><div>So, why is my host machine's ssh not honoring the -i flag, or any IdentityFile directive?</div><div><br clear="all"><div><div><div dir="ltr"><div>++++++++++++++++++++++++++</div><div>Research Fellow, Head of Metadata</div><div><a href="https://guardianproject.info" target="_blank">The Guardian Project</a></div><div><br></div>pgp: 0x0A0F0B18<br>twitter: @harlo</div></div></div>
<div dir="ltr"><br></div></div></div>
</blockquote></div><br></div>