sshpass howto
by GioMBG from LinuxQuestions.org on (#5G9N6)
hi All,
hoping to find You all well.
I need to use sshpass in an sh script,
please : avoid recommending to use a public key : I know what it is I always use but this is not the case thanks !
so normally if I run this sh script I need to insert manually the password :
Code:#!/usr/bin/sh
sftp -oPort=22 username@host.example.com<<EOF
cd /data
put /myfile.txt /log.txt
bye
exit
EOFwhat I want is to use sshpass to put the passwd directly into the script OR at the best in an external file.
Avoiding to post all the fake examples copied and re-copied and re-copied again around the web that don't want to work...
Can I kindly have an help in how to use sshpass in my scirpt.sh ?
thanks
Gio


hoping to find You all well.
I need to use sshpass in an sh script,
please : avoid recommending to use a public key : I know what it is I always use but this is not the case thanks !
so normally if I run this sh script I need to insert manually the password :
Code:#!/usr/bin/sh
sftp -oPort=22 username@host.example.com<<EOF
cd /data
put /myfile.txt /log.txt
bye
exit
EOFwhat I want is to use sshpass to put the passwd directly into the script OR at the best in an external file.
Avoiding to post all the fake examples copied and re-copied and re-copied again around the web that don't want to work...
Can I kindly have an help in how to use sshpass in my scirpt.sh ?
thanks
Gio