title: ssh agent forwarding not working on ec2
body: <p>I'm trying to use ssh agent forwarding on my local machine so that I dont have to use my private key on remote server for <code>git clone git@bitbucket.org:username/bucketname.git</code></p>
  
  <p>I have following setup on my machine:</p>
  
  <pre><code> $cat ~/.ssh/config
      Host bitbucket.org
       IdentityFile ~/.ssh/id_rsa
  
      Host 172.28.128.3
       ForwardAgent yes
  </code></pre>
  
  <p>and have added my public key to bitbucket site</p>
  
  <p>when i run <code>ssh -T git@bitbucket.org</code> it shows </p>
  
  <pre><code>logged in as &lt;username&gt;.
  You can use git or hg to connect to Bitbucket. Shell access is disabled.
  </code></pre>
  
  <p>means ssh protocol working right and I can clone any repo.</p>
  
  <p>But when I run on my remote machine/host  ( mentioned in .ssh/config file with ip 172.28.128.3)</p>
  
  <pre><code>buntu@remoteMachine$ ssh -vT git@bitbucket.org
  OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: Applying options for *
  debug1: Connecting to bitbucket.org [131.103.20.168] port 22.
  debug1: Connection established.
  debug1: identity file /home/ubuntu/.ssh/id_rsa type 1
  debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1
  debug1: identity file /home/ubuntu/.ssh/id_dsa type -1
  debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1
  debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1
  debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1
  debug1: identity file /home/ubuntu/.ssh/id_ed25519 type -1
  debug1: identity file /home/ubuntu/.ssh/id_ed25519-cert type -1
  debug1: Enabling compatibility mode for protocol 2.0
  debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
  debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
  debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  debug1: kex: server-&gt;client aes128-ctr hmac-md5 none
  debug1: kex: client-&gt;server aes128-ctr hmac-md5 none
  debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024&lt;3072&lt;8192) sent
  debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
  debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
  debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
  debug1: Server host key: RSA 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40
  debug1: Host 'bitbucket.org' is known and matches the RSA host key.
  debug1: Found key in /home/ubuntu/.ssh/known_hosts:1
  debug1: ssh_rsa_verify: signature correct
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug1: SSH2_MSG_NEWKEYS received
  debug1: Roaming not allowed by server
  debug1: SSH2_MSG_SERVICE_REQUEST sent
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug1: Authentications that can continue: publickey
  debug1: Next authentication method: publickey
  debug1: Offering RSA public key: /home/ubuntu/.ssh/id_rsa
  debug1: Authentications that can continue: publickey
  debug1: Trying private key: /home/ubuntu/.ssh/id_dsa
  debug1: Trying private key: /home/ubuntu/.ssh/id_ecdsa
  debug1: Trying private key: /home/ubuntu/.ssh/id_ed25519
  debug1: No more authentication methods to try.
  Permission denied (publickey).
  </code></pre>
  
  <p>I am using ec2 instance as remote machine.</p>
  
  <p>please help me in resolving this issue.</p>