Github SSH配置

Ric*_*ico 59 ssh config github

我正在尝试为多个SSH帐户创建一个.ssh/config文件(特别是对于github.com).我已经尝试了几个教程和github帮助演练,但似乎没有任何工作.

我创造了一个id_rsa_testid_rsa_test.pub.我上传id_rsa_test.pub到github.

然后我创建了一个~/.ssh/config包含以下内容的文件:

# github account
Host github.com-test github.com
    Hostname github.com
    User git 
    IdentifyFile ~/.ssh/id_rsa_test
Run Code Online (Sandbox Code Playgroud)

# github account
Host github.com-test github.com
    Hostname github.com
    User git 
    IdentifyFile ~/.ssh/id_rsa_test.pub
Run Code Online (Sandbox Code Playgroud)

然后我尝试几个命令.即:

git clone git@github-test:username/my_project.git

git push
Run Code Online (Sandbox Code Playgroud)

...每次我收到以下错误:

/home/username/.ssh/config: line 5: Bad configuration option: IdentifyFile
/home/username/.ssh/config: terminating, 1 bad configuration options
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

有什么建议?

tom*_*tom 164

IdentityFile是't',而不是IdentifyFile.

  • 哇,我可能会嘲笑这个答案.但是,我犯了同样的错误:/ (15认同)
  • 大声笑......我在同样的问题上喋喋不休:p (10认同)
  • 可能是计算机历史上最大的剪切粘贴#snafu (5认同)
  • 难以置信...同样的错误...我想知道为什么每个人都读Identify而不是Identity:o (3认同)
  • 这里同样的错误...有趣的是每个人都在做相同的:D (3认同)
  • 哇......漫长的一周,你开始犯愚蠢的错误.谢谢! (2认同)
  • 我什至不能责怪复制粘贴。我的手指只是打字识别。 (2认同)