Host github.com git
HostName github.com
User git
IdentityFile ~/.ssh/github # I've tried also /home/freinn/.shh/github
Run Code Online (Sandbox Code Playgroud)
没有/home/freinn/github创建文件,我必须创建它吗?
这是完整的警告:
Warning: Identity file /home/freinn/github not accessible: No such file or directory.
Hi freinn! You've successfully authenticated, but GitHub does not provide shell access.
[freinn@freinn ruby]$ ssh -v git@github
OpenSSH_5.9p1, OpenSSL 1.0.0j-fips 10 May 2012
debug1: Reading configuration data /home/freinn/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 50: Applying options for *
ssh: Could not resolve hostname github: Name or service not known
Run Code Online (Sandbox Code Playgroud)
要在 GitHub 上使用 SSH 身份验证,您需要按照GitHub 的说明创建公钥/私钥对。该IdentityFile选项应指向包含您在执行这些指令时创建的私钥的任何文件。
无论如何,看起来您连接得很好* \xe2\x80\x94 您正在看到 GitHub 的成功连接消息。也许你的 GitHub 私钥只是~/.ssh/id_rsa?如果是这样,您可以IdentityFile完全删除该行,它将按预期工作。
如果有任何帮助,我的相关部分~/.ssh/config/如下所示:
Host github.com\n IdentityFile ~/.ssh/id_rsa_github\n IdentitiesOnly yes\nRun Code Online (Sandbox Code Playgroud)\n\n\xe2\x80\xa6but 这只有效,因为~/.ssh/id_rsa_github这是我放置 GitHub 特定的 RSA 私钥的位置。
*当您从 shellYou\'ve successfully authenticated, but GitHub does not provide shell access.成功进入时, GitHub 始终会响应。ssh
| 归档时间: |
|
| 查看次数: |
11441 次 |
| 最近记录: |