0

I currently have a account on a Linux machine that I use to access the code repository. The ssh key was updated a long while back. It has been working just fine. I am no expert in GIT. I followed someone instructions to set up the Linux box. It has been awhile so I can't remember all the steps. Now, I have a new Windows machine. I would like to access my code from this Windows machine too. I have the ssh key for the Windows machine, I would like to add that to GIT. I still need to access the repository from the Linux box so I don't want to mess up the current setting.

If I add the new ssh key to GITLAB, would it append the new key to the previous key or would it override the previous key ?

3
  • 1
    Yes you can add multiple SSH keys to github Commented Nov 26, 2019 at 17:28
  • I'm not familiar with GitLab, but it should almost certainly allow you to store multiple SSH keys. The main purpose of this is to allow multiple users access to the same repository without sharing passwords, but it also lets you provide machine-specific keys for a single user. The benefit is that if one machine is compromised, you only need to disable that machine's key, without having to generate and distribute a new key to everyone. Commented Nov 26, 2019 at 17:29
  • Both GitHub and Gitlab allow multiple keys. All you have to do is try it to see. Also, please don't use those interchangeably. Commented Nov 26, 2019 at 17:36

1 Answer 1

1

Yes, you can add multiple SSH keys to a single GitHub account. GitLab has documentation showing how to set up SSH keys. Just follow those steps on each machine that you use.

I have the ssh key for the Windows machine, I would like to add that to GIT.

Note that you don't add an SSH key to Git. In fact, Git itself knows nothing about SSH. Instead, you upload your public SSH key to an online service, like GitHub or GitLab. Then you use SSH with commands like git clone and git push. The only reason Git knows to use SSH is because it is specified in the URL.

If I add the new ssh key to GITLAB, would it append the new key to the previous key or would it override the previous key ?

You don't append keys. Typically most online accounts let you add multiple keys to use for login. Adding a new key shouldn't override any existing keys.

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

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.