Hello All,
I am still new to GCE and doing my best to learn as I go, but I am having issues accessing the Git Repo I have set up on the VM Instance. I created a VM instance with a Debian 12 OS and Git was installed successfully. I create a new user named git on the system and use that account on my clients to access the remote repo using this method: git@myinstance.com:/srv/git sadly I get the following error: Permission denied (publickey). I tried to create keys for the git user on both the remote server and the clients but cannot seem to figure out how to properly allow that git user to get access from a ssh terminal.
If any one could point me in the right direction, it would be appreciated.
Hi, @BasicBlueWS.
I will recommend you to read this two article for your scenario -
And, please let me know if that does not resolve your issue.
Regards,
Mokit
Hi @BasicBlueWS,
Welcome to Google Cloud Community!
In addition to @mokit's documentation you may check this Error: Permission denied (publickey)
If you need further assistance, please reach out to our Google Cloud Support team.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Thank you for responding to me. I have read all articles and I understand the SSH key pair concept and am using it to SSH to my VM instance with the root or additional admin account I have created to manage things.
Using the command below I realized that it is not finding any key
ssh -vT
I do not know which key pair needs to go onto the VM for git access and for what user. To figure this out, I will try to explain this in a more clear way.
On my VM (private git server, I am not using GitHub) I have the following users:
root = default, which I won't be using
admin = an SU account for all server management
git = setup only for git users to push / pull and it has been set to not allow shell access for security.
All of my the clients have a typical user accounts and are setup as follows:
user1 = login in, do coding / design work and then push / pull to git using git@myinstance.com:/srv/git as described in my first post.
What keys need to be present on the VM git server? The client user1's SSH keys or a second set of SSH keys for the git user which ultimately resides on the VM, not the client?
Thanks, this is hurting my head. Almost to the point where I buy another VPS, cause this seems really hard for such a simple task that has always been a flawless setup on any other Linux server I build.
If you help me figure this out I will be very grateful.