2014-03-13 49 views
0

我試圖使用ssh keysbitbucket克隆回購。ssh密鑰中的命名事宜

我使用ssh-keygen -t rsa生成了密鑰,我使用的名稱是abcabc.pub

我無法進行連接,然後我試圖調試 ssh -v [email protected]

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). 
[email protected]:~$ cd ~/.ssh 
從我看到的ssh僅從鍵與搜索名稱 id_rsa

是正確

如此。

我記得我的家用電腦上有一些其他鍵名,系統能夠檢測到。

我改名農行id_rsa和它的工作

回答

1

嘗試

ssh -v [email protected] -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.