Github Private Team Separate SSH Keys
Asked Answered
G

2

1

I have an personal account on Github. So do a bunch of coworkers. We created a private team on Github for my team. We'd like to restrict access to the private repos to company laptops.

One way to do this is to limit to ssh keys for the devices. However, I am not sure if GitHub allows Key-sandboxing for private projects.

In short, can I set up a private team on GitHub (and associate SSH keys) such that I cannot, by mistake, access the code using my personal laptop?

(This is not a security question. If I want to be evil and access the code on my personal laptop anyways, I can do it easily.)

Genova answered 22/7, 2015 at 1:48 Comment(0)
B
0

If you have GitHub Enterprise then you are able to force the use of a certificate signed by your own organisation's Certificate Authority:

https://docs.github.com/en/organizations/managing-git-access-to-your-organizations-repositories/about-ssh-certificate-authorities

Here is how you add it:

https://docs.github.com/en/organizations/managing-git-access-to-your-organizations-repositories/managing-your-organizations-ssh-certificate-authorities

Bachman answered 7/1, 2022 at 10:38 Comment(0)
M
-1

Its pretty simple. Generate diffrent keys on each device as you figured oout

One way to do this is to limit to ssh keys for the devices

You do it simply by storeing diffrent keys on each device and on the ones you dont want to have acces to dont set up ssh keys.


Simply follow those steps and you will set up your ssh key in no time:

  • Generate a new ssh key (or skip this step if you already have a key)
    ssh-keygen -t rsa -C "your@email"

  • Once you have your key set in home/.ssh directory (or Users/<your user>.ssh under windows), open it and copy the content


How to add sh key to github account?

  • Login to github account
  • Click on the rancher on the top right (Settings)
    github account settigns
  • Click on the SSH keys
    ssh key section
  • Click on the Add ssh key
    Add ssh key
  • Paste your key and save

And you all set to go :-)

Musing answered 22/7, 2015 at 2:14 Comment(5)
Yes. But I have my personal public repos and my private repos on GitHub. How do I ensure that the private repos can only be accessed with a certain subset of keys?Genova
This is more on the lines of registering your Keys with the Private Team account. There doesn't seem to be an obvious way to do that, if I'm not wrong. Please prove me wrong. :)Genova
As far as i know you cant ensure it. The key is per account and not per repository, What you can do is to open a new user for this repo and store its keys only on the desired machines.Musing
Yeah. That's what I figured.. Thanks for the confirmation!Genova
No problem, Still ot something you can doMusing

© 2022 - 2024 — McMap. All rights reserved.