Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
720 views
in Technique[技术] by (71.8m points)

git - Github Private Team Separate SSH Keys

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.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 :-)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...