每个git回购特定的RSA密钥 [英] Specific RSA keys per git repo

查看:111
本文介绍了每个git回购特定的RSA密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以有一个仅适用于特定存储库的RSA密钥。或者类似的东西。我有用户需要能够创建一个git仓库并读/写,并管理谁可以自己读或写。我的计划是使用RSA密钥(authorized_keys)和git用户,并将密钥提供给需要连接的组。有没有办法指定rsa密钥可以访问哪些文件夹?

I was wondering if it was possible to have an RSA key that works for a specific repository only. Or something of that sorts. I have users that need to be able to create a git repo and read/write to it, and to manage who can read or write to it themselves. My plan was to use RSA keys (authorized_keys) and a git user, and giving the key to the group that needs to connect. Is there a way to specify which folders a rsa key can access?

推荐答案

是的,它受到支持。尝试将 config (没有任何扩展名)文件添加到〜。/ ssh 中,内容如下:

Yes, it is supported. Try adding config (without any extension) file to ~./ssh with content as such:

Host github.com
    HostName github.com
    User madhead
    IdentityFile ~/.ssh/id_rsa_1
Host bitbucket.org
    HostName bitbucket.org
    User madhead_
    IdentityFile ~/.ssh/id_rsa_2

这篇关于每个git回购特定的RSA密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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