0

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/ [email protected] <<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 ?

Tanay Suthar
  • 453
  • 3
  • 8
  • 19

0 Answers0