Article 5G9N6 sshpass howto

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
Giolatest?d=yIl2AUoC8zA latest?i=Q12Vr8b2N_A:-qZF6Fuhix8:F7zBnMy latest?i=Q12Vr8b2N_A:-qZF6Fuhix8:V_sGLiP latest?d=qj6IDK7rITs latest?i=Q12Vr8b2N_A:-qZF6Fuhix8:gIN9vFwQ12Vr8b2N_A
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments