Host key verification failed. when Using scp inside ssh EOL

Viewed 25

I am trying to run multiple ssh command using the bellow shell script

#!/bin/bash
ssh -T root@10.123.234.456  <<'EOL'

     '/var/map/pg_dump.sh'
     CHOOSE_DB=$(ls -t /var/mapbackup/mapdb* | head -1)
     scp -r root@10.123.234.456:$CHOOSE_DB /app/map/
     echo $CHOOSE_DB
EOL

First 2 command work well but scp fails with Host key verification failed.

Login got success for ssh but i feel scp not able to fetch password from EOL Here is the screen short of the error enter image description here

Can Someone help correcting my script

0 Answers
Related