Add Public Key to Gitlab - iff133/first GitHub Wiki

1. When creating a gitlab from the beginning or if you are trying to do a git clone and you get a permission issues follow the following steps:

  • Do: cat ~/.ssh
  • A list should appear and do again: cat ~/.ssh/id_rsa.pub
  • Your public key should appear and it starts with ssh-rsa copy this key If you want to find out when was the last time the public key was changed do either:
  • ls -l ~/.ssh/id_rsa.pub
  • stat ~/.ssh/id_rsa.pub

2. Once you have run cat ~/.ssh/id_rsa.pub go to settings in gitlab: image

3. Under Settings choose ssh keys: image

4. Add the key to the ssh key by pasting the perviously copied key into the ssh settings: image

5. Repeat the git clone to make sure it worked