ssh-keygen/ssh-keygen.exe
三台机器:A(Ubuntu),B(Windows)和C(Ubuntu)我在A和B上运行过。
~/.ssh/id_rsa.pub
来自 A 和 B 的 都 活得 很好~/.ssh/authorized_keys
。
当我从计算机 A 运行时ssh user@C
,无需密码即可顺利登录。
然而当我ssh user@C
从 BI 中跑出来时总是提示输入密码。
我看过很多建议整理权限的帖子。因为 A->C 有效,所以我的权限应该没问题。但是 B->C 无效。
从 B 运行 ssh -v user@C 时的输出
PS C:\Users\{{username_on_B}}> ssh -v {{username_on_C}}@{{IP OF C}}
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Connecting to {{IP OF C}} [{{IP OF C}}] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_rsa type 0
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\{{username_on_B}}/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3
debug1: match: OpenSSH_8.9p1 Ubuntu-3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to {{IP OF C}}:22 as '{{username_on_C}}'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression:
none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression:
none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:m9oua7tS+nmL6Z2S/AwfP5TVem8hKR26kB7PWYalye
Q
debug1: Host '{{IP OF C}}' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\{{username_on_B}}/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: C:\\Users\\{{username_on_B}}/.ssh/id_rsa RSA SHA256:WgNxKWggb/PyIok5CDMawT
CHBkpXU0LpX0On7vls5vY
debug1: Will attempt key: C:\\Users\\{{username_on_B}}/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\{{username_on_B}}/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\{{username_on_B}}/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\{{username_on_B}}/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rs
a-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk
[email protected],[email protected]>
debug1: kex_input_ext_info: [email protected] (unrecognised)
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\{{username_on_B}}/.ssh/id_rsa RSA SHA256:WgNxKWggb/PyIok5CDM
awTCHBkpXU0LpX0On7vls5vY
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: C:\\Users\\{{username_on_B}}/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\{{username_on_B}}/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\{{username_on_B}}/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\{{username_on_B}}/.ssh/id_xmss
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
{{username_on_C}}@{{IP OF C}}'s password: