sshpass: No such file or directory

4.1k Views Asked by At

Bellow command if i write inside a script (test.sh) and execute directly on the specific machine it works.

sshpass -p $HOST_PWD sftp testuser@host <<!
cd parent
mkdir test
bye
!

But when i try to run (directly below scrip or invoking the test.sh file in the specif path) in Jenkins with "Execute shall script on remote host using ssh" it failing with

sshpass: Failed to run command: No such file or directory

I have installed sshpass, lftp and rsync in the remote machine

Issue :

  • I have added export $HOST_PWD in .bashrc of specific machine as well as Jenkins but in not finding it
  • Script placed in specific machine, if directly executed the script in that machine it works even with $HOST_PWD. But not working if we invoke from jenkins either script or directly scrip using "Execute shall script on remote host using ssh"

Working with Changes :

  • Instead of $HOST_PWD if i added directly password it works.
0

There are 0 best solutions below