当我尝试使用ssh-agent中的encryption密钥ssh时,我得到以下(使用ssh -vvv ):
debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/cowens/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: BLAH debug3: sign_and_send_pubkey: RSA BLAH debug3: input_userauth_banner Access denied Access denied Connection closed by BLAH
我可以login,如果我强迫它使用密码( ssh -o PreferredAuthentications=keyboard-interactive -o PubkeyAuthentication=no ),然后,断开连接(所以它不是一个ControlMaster的东西),我可以使用密钥SSH一个问题:
debug1: Offering RSA public key: /home/cowens/.ssh/id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: pkalg ssh-rsa blen 279 debug2: input_userauth_pk_ok: BLAH debug3: sign_and_send_pubkey: BLAH debug1: Authentication succeeded (publickey). Authenticated to BLAH ([BLAH]:22). debug1: channel 0: new [client-session] debug3: ssh_session2_open: channel_new: 0 debug2: channel 0: send open debug1: Entering interactive session. debug2: callback start debug1: Requesting authentication agent forwarding. debug2: channel 0: request [email protected] confirm 0 debug2: fd 3 setting TCP_NODELAY debug3: packet_set_tos: set IP_TOS 0x10 debug2: client_session2_setup: id 0 debug2: channel 0: request pty-req confirm 1 debug1: Sending environment.
服务器使用活动目录存储用户信息,所以我认为它与此有关,但是我曾经在过去使用过AD的环境中工作过,而且没有这个问题。
在不知道机器设置的具体细节的情况下,我只能给你一个假设。 Microsoft Active Directorybuild立在LDAP上,用于用户/目录信息,Kerberos5用于authentication/encryption。
所以,这是它的核心。 当您通过Kerberos系统进行身份validation时,您将获得一张票。 例如,此票证是操作系统代表您通过networking识别您的encryption凭证。 这些票据通常具有有限的默认生存期。 我在这种情况下的猜测是大约10个小时。
你的SSH密钥对将不起作用,因为该服务器上的某些组件被configuration为需要你的票证,并获得一张Kerberos票据需要你的密码。 一旦它被发布给你(在该机器上),它就可以用于任何configuration的组件。 一旦到期,您需要进行身份validation才能获得新的身份。
我熟悉这种情况下使用pam_krb5和libnss-ldapd; 我不熟悉其他人。 如果我的猜测是正确的,一旦你在你的shell中,input'klist -v'来查看你是否已经发出一张票。
希望这可以帮助。