Closed MoGuGuai-hzr closed 4 months ago
I have observed that when a default private key, such as id_rsa
, exists in the ~/.ssh
directory, sshpiper
continuously receives downstream 10.244.0.1:63567 (username [password_test]) is sending public key auth
, and it cannot proceed to the password phase.
could you please share ssh -v password_test@xxx
by default ssh client will try password if key failed, server side (sshpiper) should ask for password
could you please share ssh -v password_test@xxx
by default ssh client will try password if key failed, server side (sshpiper) should ask for password
Here is the output of ssh -v password_test@127.0.0.1 -p 30022
.
OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 30022.
debug1: Connection established.
debug1: identity file ~/.ssh/id_rsa type 0
debug1: identity file ~/.ssh/id_rsa-cert type -1
debug1: identity file ~/.ssh/id_dsa type -1
debug1: identity file ~/.ssh/id_dsa-cert type -1
debug1: identity file ~/.ssh/id_ecdsa type -1
debug1: identity file ~/.ssh/id_ecdsa-cert type -1
debug1: identity file ~/.ssh/id_ecdsa_sk type -1
debug1: identity file ~/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file ~/.ssh/id_ed25519 type -1
debug1: identity file ~/.ssh/id_ed25519-cert type -1
debug1: identity file ~/.ssh/id_ed25519_sk type -1
debug1: identity file ~/.ssh/id_ed25519_sk-cert type -1
debug1: identity file ~/.ssh/id_xmss type -1
debug1: identity file ~/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version SSHPiper
debug1: no match: SSHPiper
debug1: Authenticating to 127.0.0.1:30022 as 'password_test'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-ed25519 SHA256:hoA5YVIYn6HLkLOH7MN30gqm+9sA3KBfrdE6hT9itzs
debug1: Host '[127.0.0.1]:30022' is known and matches the ED25519 host key.
debug1: Found key in ~/.ssh/known_hosts:14
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: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
debug1: Will attempt key: ~/.ssh/id_dsa
debug1: Will attempt key: ~/.ssh/id_ecdsa
debug1: Will attempt key: ~/.ssh/id_ecdsa_sk
debug1: Will attempt key: ~/.ssh/id_ed25519
debug1: Will attempt key: ~/.ssh/id_ed25519_sk
debug1: Will attempt key: ~/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: password,publickey
debug1: Next authentication method: publickey
debug1: Offering public key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
debug1: Server accepts key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Trying private key: ~/.ssh/id_ecdsa
debug1: Trying private key: ~/.ssh/id_ecdsa_sk
debug1: Trying private key: ~/.ssh/id_ed25519
debug1: Trying private key: ~/.ssh/id_ed25519_sk
debug1: Trying private key: ~/.ssh/id_xmss
debug1: Offering public key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
debug1: Server accepts key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Trying private key: ~/.ssh/id_ecdsa
debug1: Trying private key: ~/.ssh/id_ecdsa_sk
debug1: Trying private key: ~/.ssh/id_ed25519
debug1: Trying private key: ~/.ssh/id_ed25519_sk
debug1: Trying private key: ~/.ssh/id_xmss
debug1: Offering public key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
debug1: Server accepts key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
...
Only the unique part has been captured; the remaining part is an endless repetition of the following content:
Authenticated with partial success.
debug1: Authentications that can continue: password,publickey
debug1: Trying private key: ~/.ssh/id_dsa
debug1: Trying private key: ~/.ssh/id_ecdsa
debug1: Trying private key: ~/.ssh/id_ecdsa_sk
debug1: Trying private key: ~/.ssh/id_ed25519
debug1: Trying private key: ~/.ssh/id_ed25519_sk
debug1: Trying private key: ~/.ssh/id_xmss
debug1: Offering public key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
debug1: Server accepts key: ~/.ssh/id_rsa RSA SHA256:UPHGlpdDRyO8YXBSIxAWKASS8dwJ0cl5hey+y3d54Mg
it should not fall into infinite loop to ask you to auth, let me mark it as a bug
could you please test v1.2.8 while i am looking into it? i am thinking if it is a regression caused by partial succ
it should not fall into infinite loop to ask you to auth, let me mark it as a bug
could you please test v1.2.8 while i am looking into it? i am thinking if it is a regression caused by partial succ
Nice, v1.2.8 runs perfectly.
I created
sshpiper
and two test pods using the following files in k8s:sshpiper-service.yaml
: Used to launchsshpiper
.password-test.yaml
: Only for password login.publickey-test.yaml
: For login using either a public key or a password.If I only start items 1 and 2, I can normally log in using
ssh password_test@127.0.0.1 -p 30022
.However, if I enable item 3, then I must use
ssh password_test@127.0.0.1 -p 30022 -o PubkeyAuthentication=no
to log in.I saw a similar issue in #12 , and it seems to have been resolved. Did I configure something incorrectly?