Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29168

SSH credential not used by Windows slave

XMLWordPrintable

      I have a job configured that opens an SSH connection from a slave node to a remote system. This uses the ssh-agent plugin to choose a private key credential stored in Jenkins. The goal is to SSH from a Windows slave configured to use Cygwin for SSH.

      The ssh command is simply:

      ssh -vvv user@example.com "ls"
      

      When run on a Linux slave, the output looks like:

      authmethod_lookup publickey
      debug3: remaining preferred: keyboard-interactive,password
      debug3: authmethod_is_enabled publickey
      debug1: Next authentication method: publickey
      debug1: Offering public key: user (SSH key for example.com)
      debug3: send_pubkey_test
      debug2: we sent a publickey packet, wait for reply
      debug3: Wrote 368 bytes for a total of 1661
      debug1: Server accepts key: pkalg ssh-rsa blen 277
      debug2: input_userauth_pk_ok: SHA1 fp ####
      debug3: sign_and_send_pubkey: RSA ####
      debug3: Wrote 640 bytes for a total of 2301
      debug1: Authentication succeeded (publickey).
      

      When run on a Windows slave, the output looks like:

      debug3: authmethod_lookup publickey
      debug3: remaining preferred: keyboard-interactive,password
      debug3: authmethod_is_enabled publickey
      debug1: Next authentication method: publickey
      debug1: Trying private key: /home/user/.ssh/id_rsa
      debug3: no such identity: /home/user/.ssh/id_rsa: No such file or directory
      debug1: Trying private key: /home/user/.ssh/id_dsa
      debug3: no such identity: /home/user/.ssh/id_dsa: No such file or directory
      debug1: Trying private key: /home/user/.ssh/id_ecdsa
      debug3: no such identity: /home/user/.ssh/id_ecdsa: No such file or directory
      debug1: Trying private key: /home/user/.ssh/id_ed25519
      debug3: no such identity: /home/user/.ssh/id_ed25519: No such file or directory
      debug2: we did not send a packet, disable method
      debug3: authmethod_lookup password
      debug3: remaining preferred: ,password
      debug3: authmethod_is_enabled password
      debug1: Next authentication method: password
      debug1: read_passphrase: can't open /dev/tty: No such device or address
      debug2: we sent a password packet, wait for reply
      debug1: Authentications that can continue: publickey,gssapi-with-mic,password
      Permission denied, please try again.
      debug1: read_passphrase: can't open /dev/tty: No such device or address
      debug2: we sent a password packet, wait for reply
      debug1: Authentications that can continue: publickey,gssapi-with-mic,password
      Permission denied, please try again.
      debug1: read_passphrase: can't open /dev/tty: No such device or address
      debug2: we sent a password packet, wait for reply
      debug1: Authentications that can continue: publickey,gssapi-with-mic,password
      debug2: we did not send a packet, disable method
      debug1: No more authentication methods to try.
      Permission denied (publickey,gssapi-with-mic,password).
      

      The difference appears to be that the credential is not sent to the slave to be used as the identity in the SSH connection.

            Unassigned Unassigned
            moeglewa William Moeglein
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: