我一直在排除PubkeyAuthentication
-only问题。当我使用详细模式时,会看到很多“ key_load_public:没有这样的文件或目录”。
显然,密钥存在于文件系统上,因此该消息似乎没有惯常含义:
$ ls -al ~/.ssh/id_*
-rw------- 1 jwalton staff 751 Feb 4 2013 id_dsa
-rw------- 1 jwalton staff 608 Feb 18 2015 id_dsa.pub
-rw------- 1 jwalton staff 314 Feb 4 2013 id_ecdsa
-rw------- 1 jwalton staff 180 Feb 18 2015 id_ecdsa.pub
-rw------- 1 jwalton staff 464 Aug 23 18:15 id_ed25519
-rw------- 1 jwalton staff 103 Aug 23 18:15 id_ed25519.pub
-rw------- 1 jwalton staff 2546 Feb 4 2013 id_rsa
-rw------- 1 jwalton staff 572 Feb 18 2015 id_rsa.pub
确切地说,“ key_load_public:没有这样的文件或目录”是什么意思?
我的.ssh/config
文件有:
$ cat ~/.ssh/config
IdentityFile ~/.ssh/id_ed25519
IdentityFile ~/.ssh/id_ecdsa
IdentityFile ~/.ssh/id_dsa
IdentityFile ~/.ssh/id_rsa
添加*.pub
扩展名无效。我尝试使用和不使用这两种方法,*.pub
因为手册页对于需要指定的密钥(公共密钥或私有密钥)含糊不清。(公共密钥是标识所需要的全部;需要私钥来证明在质询/响应中密钥的所有权):
IdentityFile
Specifies a file from which the user's DSA, ECDSA or DSA authen-
tication identity is read...
$ ssh -v -p 1522 jwalton@192.168.1.11
OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /Users/jwalton/.ssh/config
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to 192.168.1.11 [192.168.1.11] port 1522.
debug1: Connection established.
debug1: identity file /Users/jwalton/.ssh/id_ed25519.pub type 4
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jwalton/.ssh/id_ed25519.pub-cert type -1
debug1: identity file /Users/jwalton/.ssh/id_ecdsa.pub type 3
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jwalton/.ssh/id_ecdsa.pub-cert type -1
debug1: identity file /Users/jwalton/.ssh/id_dsa.pub type 2
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jwalton/.ssh/id_dsa.pub-cert type -1
debug1: identity file /Users/jwalton/.ssh/id_rsa.pub type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/jwalton/.ssh/id_rsa.pub-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
...
IdentityFile
,我应该指定什么?公钥还是私钥?