3
votes

I'm trying to run a remote sh from Jenkins to change a script to executable, but I take the following error:

[-manager_feature_kubernetes-YYLYXREUAV4NHLBACWJHV5YMQFOGHM4SS7G67ASIGYSZZGVS4VBQ] Running shell script
+ sshpass -p **** ssh'****@10.XX.XX.XXX chmod u + x /home/Script.sh '
sshpass: Failed to run command: No such file or directory

The logic of my script is:         

sh "sshpass -p \" $ {passSSH} \ "ssh ${userSSH}@10.XX.XX.XXX \" chmod u + x /home/Script.sh \ ""

Can anyone help?

3

3 Answers

4
votes

Have you tried this:

sshpass -p '$rootPassword' ssh -o 'StrictHostKeyChecking=no' $isRoot@$Host "chmod u+x /home/$USER/Script.sh"
2
votes

Just write it here : my docker container did not have package lftp installed

a simple apt-get install lftp solved this issue.

Hope it will help ;)

0
votes

$rootPassword,$isRoot, $Host are Jenkins string parameter

sshpass -p ""$rootPassword"" ssh $isRoot@$Host id; echo $HOME;