gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:20:36 25 4
gpt4 key购买 nike

我正在尝试使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com