47

I just created a personal GitLab account and am trying to follow the steps on

https://gitlab.com/help/ssh/README

to deploy my SSH key to GitLab. I've completed up to step 5, and see my SSH key among 'Your SSH keys' in my User Settings -> SSH keys:

enter image description here

I'm trying to now complete the optional 6th step, testing the key:

enter image description here

My GitLab username is khpeek, so I guessed my 'GitLab domain' is gitlab.com/khpeek. However, the test command

ssh -T [email protected]/khpeek

yields an error message:

ssh: Could not resolve hostname gitlab.com/khpeek: Name or service not known

Apparently this is the wrong hostname. What would be the right one?

3 Answers 3

57

If you're using Gitlab on gitlab.com then the domain is simply gitlab.com so you should run ssh -T [email protected]

Sign up to request clarification or add additional context in comments.

2 Comments

If you're behind a proxy and you need to configure your vim ~/.ssh/config please note the hostName: Host gitlab.com HostName altssh.gitlab.com
Thank you so much @aemonge you saved me so much time. I had tried recreating ssh keys, all sorts.
6

Go to clone with ssh. And check the URL link. It should looks like this. git@hostname:project.git. git@hostname this whole part is your hostname.

1 Comment

clear, was looking for a way to find it and this made it!
0

Open your GitLab account or repository online (any site will do, just make sure your logged in). Then checkout the URL. The domain together with the TLD will be your hostname. E.g.

www.gitlab.your.institution.com/...

So in this case gitlab.your.institution.com is your hostname.

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.