sshpass is a simple and lightweight command line tool that enables us to provide password (non-interactive password authentication) to the command prompt itself, so that automated shell scripts can be executed.
Example1 - copying a file with scp:
sshpass -p $HOSTPWD scp -o StrictHostKeyChecking=no ./artifacts.zip jenkins@$HOST:~
sshpass -p $HOSTPWD ssh -o StrictHostKeyChecking=no -t -t jenkins@$HOST "(
sudo -u tomcat /opt/tomcat/bin/shutdown.sh
cd ~
rm -rf artifacts.zip
)"