I have three servers (two ubuntu 16.04, one mac mini) and several macbooks.
One server ubuntu is for gitlab and the other is an internal site server. The mac mini is running a CI.
Recently the gitlab server was replaced with another gitlab server. (Hardware replaced, same IP address and hostname, new software, new ssh key, all other hardware (the other servers and laptops) are using the ssh keys as before).
Any of the macbooks can SSH into either of the servers (using the username/password of a user on the server) and they can use Git to clone, push, etc with the git server via public key.
The site server can SSH (via public key) into the git server but once the welcome message appears the connection is terminated. The site server can not use git via public key as Git prompts for a password, except for when it doesn't and works using the public key which lasts for some time, it only starts to work using testing in the users documents directory, if I attempt to clone in the /var/www
directory git breaks again (this may be coincidence, it has only worked twice).
The CI has no issues connecting with the git server.
Using ssh -v the output shows ssh is using the correct public key.
So running the following command on the site server
ssh [email protected]
connects (and then disconnects) but
git clone [email protected]:somerepo.git
asks for the password of the git user.
The site server has a user (with a ssh key) registered on gitlab.
Example output from multiple calls: https://pastebin.com/QH0AntK7
git clone -v ssh://[email protected]:/Full/Path/To/myproject.git