I am trying to login to aws EC2 instance in batch mode through shell script, For that i ran following command
sftp -oIdentityFile="$private_key_loc" -b $(pwd)/new/ec2/batch.txt ec2-user@"$var_public_ip"
which gives me:
Host key verification failed.
Couldn't read packet: Connection reset by peer
batch.txt
put /root/Desktop/hello.txt ./
chmod 664 hello.txt
i have earlier used the following command successfully to transfer the files to the same EC2 instance in interactive mode
sftp -oIdentityFile="$private_key_loc" ec2-user@"$var_public_ip"
put hello.txt ./
chmod 664 hello.txt
Aucun commentaire:
Enregistrer un commentaire