Article 55HFN scp and sshpass

scp and sshpass

by
dmchess
from LinuxQuestions.org on (#55HFN)
I can get scp to send a file interactively where I get prompted for the server password.
If I try using sshpass in a bash script it fails. No error messages, it just doesn't show up.
Both machines are Linux Mint 19.2 running the Mate desktop.

This command works:

scp myfile.txt myuser@192.168.n.nnn:/home/myuser/Documents/mydir/

This command does not work

sshpass -p 'mypass' scp myfile.txt myuser@192.168.n.nnn:/home/myuser/Documents/mydir/

Both ssh and sshpass were downloaded from the repository. I installed openssh on both machines some time ago. I installed sshpass within the last few days on the sending machine only. Both machines are sitting on a home networklatest?d=yIl2AUoC8zA latest?i=cjpdzX64yyk:4MBkDiU8D08:F7zBnMy latest?i=cjpdzX64yyk:4MBkDiU8D08:V_sGLiP latest?d=qj6IDK7rITs latest?i=cjpdzX64yyk:4MBkDiU8D08:gIN9vFwcjpdzX64yyk
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