linux - ssh key 中的命名是否重要

标签 linux ssh bitbucket ssh-keys

我正在尝试使用 ssh key bitbucket 克隆 repo。

我用 ssh-keygen -t rsa 生成了 key ,我使用的名称是 abcabc.pub

我无法连接然后我尝试调试 ssh -v git@bitbucket.org

debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/vagrant/.ssh/id_rsa
debug1: Trying private key: /home/vagrant/.ssh/id_dsa
debug1: Trying private key: /home/vagrant/.ssh/id_ecdsa
debug1: Trying private key: /home/vagrant/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
vagrant@vagrant-ubuntu-trusty-64:~$ cd ~/.ssh

因此我看到 ssh 仅从名称为 id_rsa

的 key 中搜索

对吗?

我记得我的家用电脑上有一些其他的 key 名称,系统能够检测到它。

我将 abc 重命名为 id_rsa,它起作用了

最佳答案

尝试

ssh -v git@bitbucket.org -i /path/to/abc

手册页说

-i identity_file  Selects a file from which the identity (private key) for public 
key authentication is read. The default is ~/.ssh/identity for protocol version 1,             
 and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/id_rsa for protocol version 2. 
Identity files may also be specified on a per-host basis in the configuration 
file. It is possible to have multiple -i options (and multiple identities 
specified in configuration files).  ssh will also try to load certificate 
information from the filename obtained by appending -cert.pub to identity 
filenames.

关于linux - ssh key 中的命名是否重要,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22370256/

相关文章:

c - 使用 clone() 时出现无效参数错误

linux - SFTP 适用于 bash 但不适用于 nologin

linux - 反向 ssh 隧道

git - 无法通过 ssh 连接到 BitBucket

bitbucket - 在 Bitbucket API 中,如何获取所有许可用户的列表?

git - 使用 Git (Bitbucket) 拒绝 Dockerfile 公钥权限

linux - 报告中未显示象形文字语言 - 祖鲁语

Java 进程生成器 : command not found

mercurial - hg无法使用自定义 key 连接到bitbucket

linux - 是否有任何用于将 nodejs 应用程序上传到我自己的 linux 服务器的 linux 脚本?像 appfog 或 heroku