是否有可能在2台机器上使用相同的ssh私钥/公钥对来访问git存储库? [英] Is it possible to use the same ssh private/public key pair on 2 machines to access a git repository?

查看:735
本文介绍了是否有可能在2台机器上使用相同的ssh私钥/公钥对来访问git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近设置了一个inhouse git存储库服务器,并将其安装并运行,安装gitosis作​​为管理工具。只读访问可以通过git://协议获得,写访问可以通过gitosis使用ssh公钥获得。



我有一个开发人员已经被授予访问他的权限使用在他的桌面工作站上生成的公钥生成项目。



他现在想使用相同的ssh密钥对从他的笔记本电脑访问该存储库。他已经将完整的.ssh文件夹复制到了他的笔记本电脑上,并试图从存储库中克隆,但没有成功。



这是一个有效的尝试吗?



是否需要为每台机器生成一个ssh密钥对?这看起来很奇怪,因为它实际上需要将每台计算机用户名添加到gitosis配置中。



任何帮助都不胜感激。

解决方案

是的,我认为你可以。

我有类似的东西。两台机器,一台英特尔(桌面)另一台Sparc。我可以登录到这两台机器并使用SSH访问相同的CVS服务器(另一台机器),并使用在英特尔机器上生成的相同密钥对。



确保何时你复制你的私钥,你正确设置了.ssh目录的权限(0700),你的主目录不能是组或世界可写的。
id_rsa应该只有用户读取权限(0400)

I've recently setup an inhouse git repository server and have it up and running with gitosis installed as the management tool. Read only access is available via the git:// protocol and write access is available via gitosis using ssh public keys.

I have a developer that has been granted access to his projects with a public key that was generated on his desktop workstation.

He is now wanting to access that repository from his laptop using the same ssh key pair. He's copied has .ssh folder in it's entirety to his laptop and has tried to clone from the repository without success.

Is this a valid thing to try?

Does a ssh key pair need to be generated per machine? This seems weird as it would effectively require a per machine username to be added to the gitosis configuration.

Any help would be appreciated.

解决方案

Yes I think you can.

I have something similar. Two machines, one Intel (desktop) the other one Sparc. I can log into both machines and access the same CVS server (another machine) using SSH access with the same key pair which was generated on the Intel machine.

Make sure when you copy across your private key that you set both the permissions of the .ssh directory correctly (0700) and your home directory cannot be group or world writable. The id_rsa should only have user read access (0400)

这篇关于是否有可能在2台机器上使用相同的ssh私钥/公钥对来访问git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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