我试图在运行在Windows上的OpenSSH服务器上设置基于密钥的身份validation。 不幸的是,服务器似乎并不接受我提供的密钥,但我看不到任何特定的错误消息或错误的原因。 以下是我迄今尝试的步骤:
一般设置
按键设置
修改了ssh_config以包含以下两行:
RSAAuthentication是
PubkeyAuthentication yes
运行以下命令testing与SSH服务器的连接:
ssh -v -l CRMETLSFTP -i id_crmftp SERVERNAME
据我所知,这应该是必要的步骤。 当我与PuTTy远程连接(转换私钥后),我得到“服务器拒绝我们的密钥”。 使用-v本地testing连接,我得到以下输出:
C:\Program Files (x86)\OpenSSH>ssh -v -l CRMETLSFTP -i id_crmftp DEVCRMETL01 OpenSSH_3.8.1p1, OpenSSL 0.9.7d 17 Mar 2004 debug1: Reading configuration data /etc/ssh_config debug1: Connecting to DEVCRMETL01 [172.17.8.151] port 22. debug1: Connection established. debug1: identity file id_crmftp type 1 debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 debug1: match: OpenSSH_3.8.1p1 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_3.8.1p1 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-cbc hmac-md5 none debug1: kex: client->server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host 'devcrmetl01' is known and matches the RSA host key. debug1: Found key in /home/rbrunner/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password,keyboard-interacti ve debug1: Next authentication method: publickey debug1: Offering public key: id_crmftp debug1: Authentications that can continue: publickey,password,keyboard-interacti ve debug1: Next authentication method: keyboard-interactive debug1: Authentications that can continue: publickey,password,keyboard-interacti ve debug1: Next authentication method: password CRMETLSFTP@devcrmetl01's password:
据我所知,它正在试图正确地发送密钥。 我假设授权密钥没有正确拾取,但我不知道从哪里开始寻找。
也许有一点答案有点迟,但为了防止别人来这个问题,我会尝试以下。
ssh-user-config以确保权限等是正确的。 -d , -dd和-ddd参数启动sshd,以便在testing时不在前台分叉和打印debugging信息。 这通常比增加客户端上的debugging信息( -vvv )更有帮助。