在 Oracle Enterprise Linux 5 上安装 git 存储库 -- SSH 问题

发布于 2024-12-05 21:08:12 字数 2163 浏览 1 评论 0原文

我已经用头撞墙有一段时间了,在这一点上,我附近的人没有一个人比我知道得更多。

我的办公室有一个实验室盒子,他们想将其用作中央 git 存储库——主要用于测试各种东西。当然,他们还希望我获得一些设置 git 的经验,以便我们以后可以设置其他 git 实例。

我正在使用 OEL 5.7 虚拟机运行 Windows 7,而盒子运行的是 OEL 5.5。我通过虚拟机通过 SSH 连接到实验室盒子并开始修补。安装 git 和 gitosis 后,我成功地让实例在本地运行。我可以很好地看到 git 存储库,如果我尝试在本地克隆它,一切都像做梦一样。但是,如果我尝试从我的虚拟机通过 SSH 登录,它要么 A.) 用 fatal: 'testproject.git' does not likely to be a git repository 踢我出去,要么 B.) 用权限被拒绝(publickey,gssapi-with-mic),具体取决于我调用 git 的方式。

示例:我配置了对我创建(并在本地测试)的测试项目的访问权限,如下所示:

[group team]
writable = testproject
members = oracle@RCSDB cwerness cwerness@localhost [email protected]

这是我第一次设置 git 存储库,因此我想介绍有关远程用户的基础知识。因此,成员部分出现冗余。

当我尝试仅使用我的用户名克隆存储库时,我会得到

[cwerness@localhost Desktop]$ git clone [email protected]:testproject.git
Cloning into testproject...
Enter passphrase for key '/home/cwerness/.ssh/id_rsa': 
fatal: 'testproject.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

如果,但是,如果我尝试使用更多信息克隆存储库,我会得到

[cwerness@localhost Desktop]$ git clone "[email protected]"@10.1.1.10:testproject.git
Cloning into testproject...
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly

所有公钥都存储在 /keydir 文件夹中。该存储库已创建并由用户 oracle 拥有,我也在上述克隆命令中尝试了该用户及其域的所有排列,但没有效果。此外,我尝试设置像这样的 ~/.ssh/config 文件

Host labbox
    Hostname 10.1.1.10
    User cwerness
    IdentityFile /home/cwerness/.ssh/id_rsa

再次,我尝试了来自两个用户的所有不同的连接方式。没有什么能给我比我已经掌握的更多的信息。

该盒子被设置为通过公钥验证 SSH 连接,并且工作正常。我可以通过 SSH 作为 cwerness 进入该盒子,没有任何问题。

这对我来说是一个巨大的头痛,如果有人能准确地告诉我我是如何愚蠢的,我希望它,如果不是解决这个问题的方法。

I have been banging my head against a wall for a while now, and none of the people in my immediate vicinity know more than I do at this point.

My office has a lab box that they want to use for a central git repository -- mainly for testing various things. They also, of course, want me to get some experience setting up git so that we can possibly set up other git instances later.

I am running Windows 7 with an OEL 5.7 VM, and the box is running OEL 5.5. From my VM, I SSHed into the lab box and started tinkering. After installing git and gitosis, I have managed to get the instance working locally. I can see the git repository just fine, and if I try to clone it locally, it all works like a dream. But if I try to SSH in from my VM, it either A.) kicks me out with fatal: 'testproject.git' does not appear to be a git repository or B.) kicks me out with Permission denied (publickey,gssapi-with-mic), depending on how I invoke git.

Example: I configured the access to a test project I created (and tested locally) as follows:

[group team]
writable = testproject
members = oracle@RCSDB cwerness cwerness@localhost [email protected]

This is my first experience setting up a git repository, so I wanted to cover my bases regarding remote users. Thus, the redundancy in the members section.

When I try to clone the repository with my username only, I get

[cwerness@localhost Desktop]$ git clone [email protected]:testproject.git
Cloning into testproject...
Enter passphrase for key '/home/cwerness/.ssh/id_rsa': 
fatal: 'testproject.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

If, however, I try to clone the repository with more information, I get

[cwerness@localhost Desktop]$ git clone "[email protected]"@10.1.1.10:testproject.git
Cloning into testproject...
Permission denied (publickey,gssapi-with-mic).
fatal: The remote end hung up unexpectedly

I have all the public keys stored in the /keydir folders. The repository was created and is owned by the user oracle, and I have tried all permutations of that user and its domain in the above clone commands as well, to no effect. Additionally, I tried setting up a ~/.ssh/config file like this

Host labbox
    Hostname 10.1.1.10
    User cwerness
    IdentityFile /home/cwerness/.ssh/id_rsa

Again, I tried all the different ways to connect, from both users. Nothing is giving me any more information than I already had.

The box is set up to authenticate SSH connections via public keys, and that works fine. I can SSH into the box as cwerness with no problems.

This is getting to be a huge headache for me, and I'd like it if someone could tell me exactly HOW I am being stupid, if not a way to fix this problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

够钟 2024-12-12 21:08:12

git clone [电子邮件受保护]:testproject.git 将在用户 cwerness 的主目录中查找,但您声明您将存储库放入/home/oracle/repositories。尝试 git clone [电子邮件受保护]:/home/oracle/存储库/testproject.git。

git clone [email protected]:testproject.git will look in the home directory for the user cwerness but you state you put the repository in /home/oracle/repositories. Try git clone [email protected]:/home/oracle/repositories/testproject.git.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文