I am trying to run multiple ssh command using the bellow shell script
#!/bin/bash ssh -T firstname.lastname@example.org <<'EOL' '/var/map/pg_dump.sh' CHOOSE_DB=$(ls -t /var/mapbackup/mapdb* | head -1) scp -r email@example.com:$CHOOSE_DB /app/map/ echo $CHOOSE_DB EOL
First 2 command work well but scp fails with Host key verification failed.
Can Someone help correcting my script
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.