小编zgi*_*gia的帖子

ssh无法在文件〜/ .ssh/config中使用IdentityFile配置

客户端:Mac 10.8,服务器:Ubuntu 10.04 LTS 64bit

我使用' ssh-keygen -t rsa '生成公钥/私钥.

首先,我输入:ssh -i /Users/phenix/.ssh/poponet_rsa root@popo.net,我可以使用私钥"poponet_rsa"登录服务器

接下来,我创建一个配置文件:/Users/phenix/.ssh/config,内容如下:

Host popo
    Hostname popo.net
    User root
    PreferredAuthentications publickey
    IdentityFile /Users/phenix/.ssh/poponet_rsa
Run Code Online (Sandbox Code Playgroud)

我输入ssh root@popo.net,终端问我密码.

接下来,我将poponet_rsa文件名更改为id_rsa,并输入ssh root@popo.net,好的,我登录.

我的问题:ssh不能在文件〜/ .ssh/config中使用IdentityFile配置,为什么?

$ ssh -vvv root@popo.net
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /Users/phenix/.ssh/config
debug1: /Users/phenix/.ssh/config line 1: Applying options for popo.net
debug1: /Users/phenix/.ssh/config line 2: Applying options for popo.net
debug1: Reading configuration data /etc/ssh_config …
Run Code Online (Sandbox Code Playgroud)

ssh rsa private-key

7
推荐指数
3
解决办法
2万
查看次数

标签 统计

private-key ×1

rsa ×1

ssh ×1