我试图让ssh工作机智pp键。 但是,在遵循几个howto之后,我仍然遇到login问题。 服务器是opensuse 12.1,客户端是mac。 这是详细的输出:
debug1: Reading configuration data /etc/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.1.139 [192.168.1.139] port 22. debug1: Connection established. debug1: identity file /Users/me/.ssh/id_rsa type 1 debug1: identity file /Users/me/.ssh/id_rsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8 debug1: match: OpenSSH_5.8 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client->server aes128-ctr 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 '192.168.1.139' is known and matches the RSA host key. debug1: Found key in /Users/me/.ssh/known_hosts:7 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: Roaming not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/me/.ssh/id_rsa debug1: Authentications that can continue: publickey,keyboard-interactive debug1: Next authentication method: keyboard-interactive Password:
任何人的想法在哪里寻求? 谢谢
从客户端进一步debugging是不可能的。 客户端提供密钥,不被接受,它必须是服务器端的问题。 找出原因的最快捷的方法是,如果可行的话,就是在debugging模式下启动另一个sshd,它将告诉你密钥被拒绝的原因。 在服务器端:
/usr/sbin/sshd -d -p 2222
它将在debugging模式下在端口2222上启动一个sshd(一个不同的端口,这样我们就不会打扰端口22上运行的服务器)。
然后在客户端:
ssh -p 2222 user@remotehost
你应该看到你的钥匙在你开始sshd的terminal被拒绝的原因。
通常问题是权限过于宽松。 authorized_keys文件和整个目录祖先不能由除了用户以外的任何人写入。 因此,如果authorized_keys文件位于/home/username/.ssh/authorized_keys中,那么例如/,/ home,/ home / username都不能是组可写的。
看起来键是在系统上生成的,而不是你要连接的那个。 在要绑定的系统上生成密钥。
您是先连接到VPN隧道,然后再连接到服务器。 如果是这种情况,那么你也会得到同样的错误,因为你没有更多的机器连接到受保护的资源。