0
votes

I am trying to use sh or ssh to connect to a linux box via jenkins (I am a noob admittedly). Even trying a ls command I am getting error - I did have this working before however - any help greatly appreciated.

Building in workspace /var/lib/jenkins/jobs/Demo/workspace executing script:

USER="jenkins"   sh '''#!/bin/bash 
HOST=10.59.151.121 
USER=devuser 
PASSWORD=TGMCfpfS 
ls   
bye 
EOF 
''' 

: No such file or directory [SSH] exit-status: 127 Build step 'Execute shell script on remote host using ssh' marked build as failure Finished: FAILURE

1
One of the problem could be is while you are trying to login you might have to handle for RSA fingerprint authentication : try once you using the below command in your script while login. ssh -o StrictHostKeyChecking=no -l username hostname "pwd; ls" - anshul Gupta

1 Answers

0
votes

For some reason I found that adding commands after the ''' allows them to be executed - even although the same warning appears, it works fine!