As I am running this script as a Cron Job, I need to enter username and password every time when I try to SFTP to host. Below is the sample script I made which demands some modifications
#!/bin/sh
sftp -i /path/to/private/key/ username@123.123.123.123 <<EOF
put /home/sample.txt /home/
exit
EOF
Instead of private key path, I believe we insert password path. Although this is human intervention. I need it to be automated.
How can I resolve the issue ?