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 network


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 network