4

I just joined gitlab, was formally on using GitHub, still is.
I created a new project on gitlab and I am trying to push but am getting a permission denied(public key) error.

This are the list of files I have in the ssh folder on my system:

  1. github_rsa,
  2. github_rsa.pub,
  3. known_hosts.

When I checked for how to generate an ssh key, I saw on gitlab that firstly I should type %userprofile%\.ssh\id_rsa.pub in command line to check if I have it and I typed it in exactly as %userprofile%\.ssh\id_rsa.pub, and I got this

C:\Users\slodd' is not recognized as an internal or external command operable program or batch file. 

I don't know if I typed it in wrong by typing it in exactly because I actually just copied and pasted it on commandline.
I haven't worked with ssh keys before. I'm using a windows 10 system.

0

1 Answer 1

2

What you need to do is to generate an ssh key dedicated to your gitlab server:

ssh-keygen -t rsa -f "%USERPROFILE%\.ssh\gitlab_rsa" -C "key for GitLab access" -q -P ""

Make sure your <git>/usr/bin folder is in your %PATH% for ssh-keygen to be recognized as a command.

Then reference your private key in your %USERPROFILE%/.ssh/config file.

#
# Main gitlab.com server
#
Host gitlab.com
RSAAuthentication yes
IdentityFile 'C:\Users\slodd\.ssh\gitlab_rsa
User git
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.