Checking Your Connection to GitLab or GitHub

Here’s how you can quickly check your local workstation for proper setup to either GitLab or GitHub.

But First …

Step by Step

Go to the web site and login (depending on how you signed up).

Click on your icon in the top right.

At this point you might want to make your window bigger so you can see the writing in the left sidebar.

Find the SSH Keys near the bottom left in the sidebar.

Notice the big empty text field.

You are ready to paste in your public key, but now we have to go get it from your terminal.

Return to your terminal command line.

We will use the cat command to dump out the content of your public key, which lives in ~/.ssh/ by default.

cat ~/.ssh/

Select that output with your mouse and copy it.

With the public key in your paste buffer now return to the web page.

Paste into the text field.

Now you should see the name and other field update as well.

Click on the green Add Key button.

Your public key is now updated.

Let’s test it from the terminal. Return to the terminal command line.

I call this a “git ping” since it is a way to check that GitLab or GitHub know about you.

Even though ssh is disabled on these services, attempting to remotely connect to them with ssh from the command line shows us if everything is working as expected.


Don’t use your username, use

If you are asked about “man in the middle” just answer yes. It is making sure you want to remember your connection with that service for next time to protect you from man in the middle attacks.

If everything is working you should see a friendly greeting from the service.

Pseudo-terminal will not be allocated because stdin is not a terminal.
Welcome to GitLab, @robmuh

I sometimes alias these in my ~/.bashrc for myself or lab workstations.

alias glping='ssh'
alias ghping='ssh'