Web and App Development Tutorials

Ubuntu - 18.04 - Setup a SSH Key for Your GitLab Account

Step 1 List SSH Directory

List SSH Directory

List SSH directory. It's not %100 necessary but good to know if you have existing GitLab SSH keys.

Step 2 Go into Your SSH Directory

Go into Your SSH Directory

Go into the ssh directory by running the cd command also called the change directory command.

Step 3 Use SSH Generator to Generate Key for Your GitLab Account

Use SSH Generator to Generate Key for Your GitLab Account

Generate a SSH key using the Linux ssh-keygen command using your own email attached to you GitLab account.

Step 4 Add RSA File by Following the on Screen Steps

Add RSA File by Following the on Screen Steps

Follow each on-screen step to generate a RSA file. Doesn't have to be named gitlab_rsa but as a suggestion copy the below name for better organization.

Step 5 Make Sure SSH Agent is On

Make Sure SSH Agent is On

Make Sure SSH Agent is On

Step 6 Add Information to SSH

Add Information to SSH

For single sign-on capabilities, make sure to add your new SSH configuration to the ssh-agent helper program to keep track of your identtiy gey and passphares. This is to make sure you don't have to type a password all the time.

Step 7 Check and Copy SSH Key

Check and Copy SSH Key

There're several ways to copy a SSH key, since everyone doesn't have programs like xcopy installed. This is the most universal (but manual) way to copy your public SSH key to your GitLab account.