Github 私人团队分离 SSH 密钥 [英] Github Private Team Separate SSH Keys

查看:24
本文介绍了Github 私人团队分离 SSH 密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Github 上有一个个人帐户.一群同事也是如此.我们在 Github 上为我的团队创建了一个私人团队.我们希望限制公司笔记本电脑访问私人存储库.

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.

一种方法是限制设备的 ssh 密钥.但是,我不确定 GitHub 是否允许对私有项目进行 Key-sandboxing.

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.

简而言之,我可以在 GitHub 上建立一个私人团队(并关联 SSH 密钥),这样我就不能使用我的个人笔记本电脑错误地访问代码吗?

(这不是一个安全问题.如果我想作恶并访问我个人笔记本电脑上的代码,我可以轻松完成.)

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

推荐答案

非常简单.按照您的想法在每个设备上生成不同的密钥

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

一种方法是限制设备的 ssh 密钥

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

您只需将不同的密钥存储在每台设备上以及您不想访问的设备上即可,无需设置 ssh 密钥.

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.

只需按照这些步骤操作即可立即设置 ssh 密钥:

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

  • 生成新的 ssh 密钥(如果已有密钥则跳过此步骤)
    ssh-keygen -t rsa -C "your@email"

home/.ssh 目录(或 Windows 下的 Users/.ssh)中设置密钥后,打开它并复制内容

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

  • 登录github账号
  • 点击右上角的牧场主(设置)
  • 点击SSH 密钥
  • 点击添加ssh密钥
  • 粘贴您的密钥并保存

你们都准备好了:-)

这篇关于Github 私人团队分离 SSH 密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆