客户端Tectia,用rsa生成了private/publickeys.publickey放到某台服务器上工作得很正常,但是同一个publickey放到Redhat的服务器上则无法正常工作。加-vvv参数出现的提示有如下信息
debug:Ssh2AuthPubKeyClient:Trying1keycandidates…
debug:Ssh2AuthPubKeyClient:Allkeysdeclinedbyserver,disablingmethod.debug:SshProtoAuthClient:Method’pblickey’disabled.
用如上关键字搜到一个帖子”Connect to a linux box from Windows using RSA authentication” 里面有如下解释The OpenSSH daemon does not use the key format used by the SSHCommunications implementation, nor does it use the same config file format. You will need to convert your publickey to OpenSSH’s format. See -i option in OpenSSH’s ssh-keygen man page. Also man authorized_keys.
我的理解就是我客户端用的是Tectia,一个SSHCommunication实现,它的publickey格式跟OpenSSH(RedHat默认sshserver)不一样。用如下命令在服务器上转换一下
ssh-keygen -i -f key.pub>>~/.ssh/authorized_keys
key.pub是客户端生成的publickey.
再次尝试,通过。
另外,我的.ssh目录权限是700,authorized_keys文件权限是600.不求甚解,仅记录一下,为我或者别人日后查看。