zs@zs-X250:~/Documents/github/neutron-liberty$ md5sum ~/.ssh/id_rsa ~/.ssh/id_rsa.bak
d76336e3d0c297778ab9c79a40c09ab3 /home/zs/.ssh/id_rsa
d76336e3d0c297778ab9c79a40c09ab3 /home/zs/.ssh/id_rsa.bak
zs@zs-X250:~/Documents/github/neutron-liberty$ ll ~/.ssh/id_rsa ~/.ssh/id_rsa.bak
-rw------- 1 zs zs 1675 12月 15 16:34 /home/zs/.ssh/id_rsa
-rw------- 1 zs zs 1675 12月 15 18:29 /home/zs/.ssh/id_rsa.bak
zs@zs-X250:~/Documents/github/neutron-liberty$ ssh root@10.89.153.51 -i ~/.ssh/id_rsa
root@10.89.153.51's password:
zs@zs-X250:~/Documents/github/neutron-liberty$ ssh root@10.89.153.51 -i ~/.ssh/id_rsa.bak
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-32-generic x86_64)
* Documentation: https://help.ubuntu.com/
有人在ubuntu15.10里面遇到这个问题吗?感觉完全无从下手啊
ssh登录使用2个一样的私钥,一个能登录,一个不能登录是什么鬼!
- langyxxl
- 帖子: 443
- 注册时间: 2012-01-17 22:17
- lainme
- 论坛版主
- 帖子: 7805
- 注册时间: 2008-09-13 19:17
- 系统: Arch Linux (x86_64)
- 联系:
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ssh登录使用2个一样的私钥,一个能登录,一个不能登录是什么鬼!
sudo cat /etc/ssh/ssh_config | grep IdentityFile
- langyxxl
- 帖子: 443
- 注册时间: 2012-01-17 22:17
Re: ssh登录使用2个一样的私钥,一个能登录,一个不能登录是什么鬼!
@poloshiao
我今天打开电脑,发现这2个私钥都能用来登录了,不知道为什么。。。
感觉好神奇啊。以后出了问题先重启电脑试试
我今天打开电脑,发现这2个私钥都能用来登录了,不知道为什么。。。
感觉好神奇啊。以后出了问题先重启电脑试试
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ssh登录使用2个一样的私钥,一个能登录,一个不能登录是什么鬼!
看看发现这2个私钥都能用来登录了
sudo cat /etc/ssh/ssh_config | grep IdentityFile
這是你執行 ssh 指令時
在 client 端 用來確認執行者身份 使用的檔案
詳細參見ssh root@10.89.153.51 -i ~/.ssh/id_rsa
ssh root@10.89.153.51 -i ~/.ssh/id_rsa.bak
http://manpages.ubuntu.com/manpages/viv ... ssh.1.html
ssh — OpenSSH SSH client (remote login program)
-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,
~/.ssh/id_ed25519 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.
multiple identities 是允許許多身份確認的檔案存在
意思是 只有 ~/.ssh/id_rsa 或 ~/.ssh/id_rsa.bak 是唯一存在的有效確認身份的檔案
否則 下結論說 是 ~/.ssh/id_rsa 或 ~/.ssh/id_rsa.bak 的功勞 考能需要查證