SFTP with using password in a shell script
Posted on 2014-02-18
I am setting up a SFTP connection, however, need to pass a password to the site.
I normal use a key , however, this time need to use a password. How do I pass a password with the below information.
This is what I use in the script. (when using a key)
cat /dev/null > $ftp_commands_file
cat /dev/null > $ftp_error_file
echo "lcd /dev/tmp" >> $ftp_commands_file
echo "put $file $/home/dev/$file" >> $ftp_commands_file
sftp -b $sftp_commands_file $user@$nodename >> $sftp_error_file
Thanks for the help.