and how it worked for you: ssh password less connection works fine (using rsa public key). i followed below steps to do this: i followed below steps to resolve it till now but didnt work: - Create an SSH key pair (public/private) Ran the command “ssh-keygen -t rsa -C "Jenkins agent key" -f "jenkinsAgent_rsa" “ - Create an SSH credential in the Jenkins machine and put the private key there Created the credentials and put jenkinsAgent_rsa into it. - Create an SSH agent see https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md#configure-launch-agents-via-ssh – This is creating a node which I didn’t do before – so I created the node and selected the credential with the private key. The verification strategy slect is non-verifying. - Select the SSH credential created before as credentials - Chose the verification strategy that you want, see the documentation, if you have problems start with the "Non verifying Verification Strategy" you can change it later - Add the public key on ~/.ssh/authorized_keys This was done but i am not able to establish the connection between jenkins and ssh server my ssh and jenkins server both are hosted on same ip
On Thursday, July 16, 2020 at 10:27:40 AM UTC+2 shrik...@gmail.com wrote: > Jenkins ver. 2.190.3 <https://jenkins.io/> on RHEL-7.7 > > Hello Jenkins Gurus / Users, > Has anyone come across similar issues as me & resolved? > ssh password less connection works fine (using rsa public key). > my shell script works fine if I run from command prompt in Jenkins system; > However the same script fails through Jenkins job. Please see part of the > console output for the error; the job is successful, but it does not copy > intended file to the remote host. > > > debug1: Connection established. > debug1: permanently_set_uid: 0/0 > debug1: identity file /root/.ssh/id_rsa type 1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_rsa-cert type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_dsa type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_dsa-cert type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_ecdsa type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_ecdsa-cert type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_ed25519 type -1 > debug1: key_load_public: No such file or directory > debug1: identity file /root/.ssh/id_ed25519-cert type -1 > debug1: Enabling compatibility mode for protocol 2.0 > debug1: Local version string SSH-2.0-OpenSSH_7.4 > debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3 > debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000 > debug1: Authenticating to Host1:22 as 'xyz' > debug1: SSH2_MSG_KEXINIT sent > debug1: SSH2_MSG_KEXINIT received > debug1: kex: algorithm: diffie-hellman-group-exchange-sha256 > debug1: kex: host key algorithm: ssh-rsa > debug1: kex: server->client cipher: aes128-ctr MAC: uma...@openssh.com > compression: none > debug1: kex: client->server cipher: aes128-ctr MAC: uma...@openssh.com > compression: none > debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16 > debug1: kex: diffie-hellman-group-exchange-sha256 need=16 dh_need=16 > debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent > debug1: got SSH2_MSG_KEX_DH_GEX_GROUP > debug1: SSH2_MSG_KEX_DH_GEX_INIT sent > debug1: got SSH2_MSG_KEX_DH_GEX_REPLY > debug1: Server host key: ssh-rsa > SHA256:DZ+zWvrtcOKUjQqdV68PgiRjDI1F3mJtBhVoXq5uGhk > debug1: Host 'Host1' is known and matches the RSA host key. > debug1: Found key in /root/.ssh/known_hosts:10 > debug1: rekey after 4294967296 blocks > debug1: SSH2_MSG_NEWKEYS sent > debug1: expecting SSH2_MSG_NEWKEYS > debug1: SSH2_MSG_NEWKEYS received > debug1: rekey after 4294967296 blocks > debug1: SSH2_MSG_SERVICE_ACCEPT received > debug1: Authentications that can continue: > publickey,gssapi-keyex,gssapi-with-mic,password > debug1: Next authentication method: gssapi-keyex > debug1: No valid Key exchange context > debug1: Next authentication method: gssapi-with-mic > debug1: Unspecified GSS failure. Minor code may provide more information > No Kerberos credentials available (default cache: KEYRING:persistent:0) > > debug1: Unspecified GSS failure. Minor code may provide more information > No Kerberos credentials available (default cache: KEYRING:persistent:0) > > debug1: Next authentication method: publickey > debug1: Offering RSA public key: /root/.ssh/id_rsa > debug1: Authentications that can continue: > publickey,gssapi-keyex,gssapi-with-mic,password > debug1: Trying private key: /root/.ssh/id_dsa > debug1: Trying private key: /root/.ssh/id_ecdsa > debug1: Trying private key: /root/.ssh/id_ed25519 > debug1: Next authentication method: password > debug1: read_passphrase: can't open /dev/tty: No such device or address > debug1: Authentications that can continue: > publickey,gssapi-keyex,gssapi-with-mic,password > Permission denied, please try again. > debug1: read_passphrase: can't open /dev/tty: No such device or address > debug1: Authentications that can continue: > publickey,gssapi-keyex,gssapi-with-mic,password > Permission denied, please try again. > debug1: read_passphrase: can't open /dev/tty: No such device or address > debug1: Authentications that can continue: > publickey,gssapi-keyex,gssapi-with-mic,password > debug1: No more authentication methods to try. > Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). > lost connection > Finished: SUCCESS > > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e4caa715-0443-4172-b6cd-9145bedf8d0an%40googlegroups.com.