Go to ssh folder

cd ~/.ssh

Create an SSH key

ssh-keygen -t rsa

Go through the prompts, don’t enter a password unless you want to enter a password every time you use the key.

Copy the public key contents

cat id_rsa.pub
# Then copy the output to clipboard

Go to Gitlab > Click on your profile > Configuration >SSH Keys. Then Click on Add New Key. Then paste the contents of the key, and remove the expiration date if you don’t want it to expire.

Leave a Reply

Your email address will not be published. Required fields are marked *