recently I've setup a gitlab server on one of my VM using Ubutun 16.04LTS.
I used this guide for installation
https://about.gitlab.com/downloads/#ubuntu1604
After the installation a added a Let's encrypt SSL certificate to the server and created a user account.
I then added my Personal SSH Key to my user to use it with git. After creating a project and trying to push to the server, I got this message from ssh
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I then ran ssh -vt git@
gitlab_server
which gave me this output
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data ~/.ssh/config
debug1: ~/.ssh/config line 4: Applying options for git_server
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to git_server [X.XXX.XX.XX] port 22.
debug1: Connection established.
debug1: identity file ~/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file~/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file ~/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubunt u-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to git_server:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:MC5S3xEGKLoL+ch2qxNmK1dPPKos hLWZAVmxNV9yAEg
debug1: Host 'git_server' is known and matches the ECDSA host key.
debug1: Found key in ~/.ssh/known_hosts:11
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: ~/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Trying private key: ~/.ssh/id_ecdsa
debug1: Trying private key: ~/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
Using the same SSH Key with GitHub is working flawlessly, which might be an indicator that there's a server problem