简短版本:如何禁用/覆盖默认的 SSH 身份文件位置~/.ssh/id_{rsa,dsa}
并强制SSH 使用另一个(第一个)?
长版:
我正在尝试使用 ssh 密钥访问设置gitolite。从我的客户端,我想使用我的默认~/.ssh/id_rsa
身份访问 gitolite-admin 存储库,而我已经创建了一个单独的身份~/.ssh/id_rsa_git
来访问普通存储库。
此外,我在以下位置创建了一个 SSH 别名~/.ssh/config
:
Host git
Hostname <servername>
User gitolite
ForwardX11 no
ForwardAgent no
GSSAPIAuthentication no
IdentityFile ~/.ssh/id_rsa_git
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试以非管理员用户身份访问 gitolite 存储库时,我得到
$ ssh -v git true
OpenSSH_6.0p1 Debian-4, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/jaap/.ssh/config
debug1: /home/jaap/.ssh/config line 105: Applying options for git
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options …
Run Code Online (Sandbox Code Playgroud)