Search code examples
gitubuntugithubssh-keyslinode

Git clone, push and pull from multiple users on Ubuntu server


Background

I have a Linode server with Ubuntu 16.04 as on OS on it. The server is for my internal team. We have repos hosted on github, bitbucket and gitlab. Only server admin has the access to the server.

We have generated ssh keys for all the users, added them to git providers and cloned the repos

Problem Statement

Whenever I do git pull on server, it always asks for the main passphrase of main key file

Enter passphrase for key '/root/.ssh/id_rsa': 

When I enter the passphrase, it shows me Permission denied error

enter image description here


Solution

  • That simply means the public key for that (passphrase-protected) private key is not registered on the remote hosting service side (GitHub or BitBucket or GitLab)

    See "Testing your SSH connection"

    See also "Multiple GitHub Accounts & SSH Config" to manage multiple identities.