I've had this issue a few times and usually because gitlab runner is expecting ssh with the same user it runs as.
I can fix it by either adding "-i /home/peter/.ssh/id_rsa" to the ci yml script or by creating a config file inside the .ssh folder of the user trying to do the ssh handshake and specify the identity file path in there