title: ssh -t keeps asking for password on gitlab server hosted with docker on a vps
body: <p>I am trying to build a webserver in which i can assign certain branches of repo's to different domains so that i can easily test and deploy to my live webapps. So at this moment, i have 3 docker containers running (Mysql, PHPMyAdmin and Gitlab). I managed to setup Gitlab to take over my repo hosted at Github and now i am trying to be able to commit changes to my vpn hosted repo. However it seems that even though my key is set-up and recognised, i still get a password prompt.</p>
  
  <p>The server is running Ubuntu 18.04 with Docker 19.03.1. I am connecting through a Windows 7 machine cmd terminal. I am planning to run several different sites with different domains on this server.</p>
  
  <p>"docker ps" returns the following:</p>
  
  <pre><code>xxxxxxxxxxxx        gitlab/gitlab-ce        "/assets/wrapper"        45 hours ago        Up 45 hours (healthy)   0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp, 22/tcp, 0.0.0.0:30022-&gt;30022/tcp   gitlab
  xxxxxxxxxxxx        phpmyadmin/phpmyadmin   "/docker-entrypoint.…"   2 days ago          Up 2 days               0.0.0.0:8081-&gt;80/tcp                                                         phpmyadmin
  xxxxxxxxxxxx        mysql:8.0.1             "docker-entrypoint.s…"   2 days ago          Up 2 days               3306/tcp                                                                     mysql-server
  </code></pre>
  
  <p>If i run "ssh -Tv" git@gitlab.myserver.net i get the following result:</p>
  
  <pre><code>debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Connecting to gitlab.myserver.net [xxx.xxx.xxx.xxx] port 22.
  debug1: Connection established.
  debug1: identity file /c/Users/user/.ssh/id_rsa type -1
  debug1: identity file /c/Users/user/.ssh/id_rsa-cert type -1
  debug1: identity file /c/Users/user/.ssh/id_dsa type -1
  debug1: identity file /c/Users/user/.ssh/id_dsa-cert type -1
  debug1: identity file /c/Users/user/.ssh/id_ecdsa type -1
  debug1: identity file /c/Users/user/.ssh/id_ecdsa-cert type -1
  debug1: identity file /c/Users/user/.ssh/id_ed25519 type -1
  debug1: identity file /c/Users/user/.ssh/id_ed25519-cert type -1
  debug1: identity file /c/Users/user/.ssh/id_xmss type -1
  debug1: identity file /c/Users/user/.ssh/id_xmss-cert type -1
  debug1: Local version string SSH-2.0-OpenSSH_7.9
  debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
  debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
  debug1: Authenticating to gitlab.myserver.net:22 as 'git'
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  debug1: kex: algorithm: curve25519-sha256
  debug1: kex: host key algorithm: ecdsa-sha2-nistp256
  debug1: kex: server-&gt;client cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none
  debug1: kex: client-&gt;server cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none
  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  debug1: Server host key: ecdsa-sha2-nistp256 SHA256:SOMERANDOMSTRINGOFCHARACTERS 
  debug1: Host 'gitlab.myserver.net' is known and matches the ECDSA host key.
  debug1: Found key in /c/Users/user/.ssh/known_hosts:6
  debug1: rekey after 134217728 blocks
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug1: SSH2_MSG_NEWKEYS received
  debug1: rekey after 134217728 blocks
  debug1: Will attempt key: My Name and Last name RSA SHA256:SOMERANDOMSTRINGOFCHARACTERS  agent
  debug1: Will attempt key: /c/Users/user/.ssh/id_rsa
  debug1: Will attempt key: /c/Users/user/.ssh/id_dsa
  debug1: Will attempt key: /c/Users/user/.ssh/id_ecdsa
  debug1: Will attempt key: /c/Users/user/.ssh/id_ed25519
  debug1: Will attempt key: /c/Users/user/.ssh/id_xmss
  debug1: SSH2_MSG_EXT_INFO received
  debug1: kex_input_ext_info: server-sig-algs=&lt;ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521&gt;
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug1: Authentications that can continue: publickey,password
  debug1: Next authentication method: publickey
  debug1: Offering public key: My First and Last Name RSA SHA256:SOMERANDOMSTRINGOFCHARACTERS agent
  debug1: Authentications that can continue: publickey,password
  debug1: Trying private key: /c/Users/user/.ssh/id_rsa
  debug1: Trying private key: /c/Users/user/.ssh/id_dsa
  debug1: Trying private key: /c/Users/user/.ssh/id_ecdsa
  debug1: Trying private key: /c/Users/user/.ssh/id_ed25519
  debug1: Trying private key: /c/Users/user/.ssh/id_xmss
  debug1: Next authentication method: password
  </code></pre>
  
  <p>It seems that it tries to offer the registered key that i have stored in my user agent (i offer this through pageant). However right after it has checked every possible location for a key, and decided that it either wants to authenticate with the key or a password, it just skips past the key and prompts me for a password. </p>
  
  <p>I tried several different key types that are supported by GitLab, i tried putting "ssh://" in front of the path but that just makes it unable to connect to the server whatsoever. And i tried searching in the GitLab and Docker documentation, and all over SO and other troubleshoot sites for similar problems, but i can't seem to find a similar situation. What would be the best way to tackle this problem?</p>