小编Alv*_*eda的帖子

我怎么能阻止 ssh 提供错误的密钥?

(这是ssh的问题,不是gitolite)

我已经在我的家庭服务器(ubuntu 12.04 服务器,open-ssh)上配置了 gitolite。我想要一个特殊的身份文件来管理存储库,因此我需要使用两个不同的身份密钥通过 ssh 访问我自己的主机。

这是我的 .ssh/config 文件的内容:

Host gitadmin.gammu.com
User            git
IdentityFile    /home/alvaro/.ssh/id_gitolite_mantra

Host git.gammu.com
User            git
IdentityFile    /home/alvaro/.ssh/id_alvaro_mantra
Run Code Online (Sandbox Code Playgroud)

这是我的主机文件的内容:

# Git
127.0.0.1      gitadmin.gammu.com
127.0.0.1      git.gammu.com
Run Code Online (Sandbox Code Playgroud)

所以我应该能够通过这种方式与 gitolite 通信以访问“正常”帐户:

$ssh git.gammu.com 
Run Code Online (Sandbox Code Playgroud)

以及通过管理帐户访问的这种方式:

$ssh gitadmin.gammu.com
Run Code Online (Sandbox Code Playgroud)

当我尝试使用普通帐户访问时,一切正常:

alvaro@mantra:~/.ssh$ ssh git.gammu.com
PTY allocation request failed on channel 0
hello alvaro, this is gitolite 2.2-1 (Debian) running on git 1.7.9.5
the gitolite config gives you the following access:
    @R_ @W_    testing
Connection to git.gammu.com closed.
Run Code Online (Sandbox Code Playgroud)

当我对管理帐户执行相同操作时:

alvaro@mantra:~$ ssh gitadmin.gammu.com
PTY allocation …
Run Code Online (Sandbox Code Playgroud)

ssh identity-management gitolite

39
推荐指数
2
解决办法
3万
查看次数

标签 统计

gitolite ×1

identity-management ×1

ssh ×1