Page 1 of 1

SCP in CLI script

Posted: 04 Dec 2015 16:27
by kave_dish
Hi,

I'm trying to use a CLI script to export a file via SCP. The script uses the scp command, and then enters the password when prompted. It contains lines akin to:

Code: Select all

scp filename.dat user@location
mypassword
However, since the password prompt isn't the standard user prompt (it's literally just "Password:", instead of "devicename#"), the script won't drop in the "mypassword" line. Is there any way to get this working?

Re: SCP in CLI script

Posted: 06 Dec 2015 09:02
by sadim
Hi,
try: sshpass -p "mypassword" scp filename.dat user@location

Regards

Re: SCP in CLI script

Posted: 07 Dec 2015 13:30
by kave_dish
sadim wrote:Hi,
try: sshpass -p "mypassword" scp filename.dat user@location

Regards
Thanks for the reply. No luck. It didn't recognize the sshpass command. Here's the failure message:

CLI command "sshpass -p "mypassword" filename.dat user@location" failed. CLI output is Last result:Error: Bad command.

Re: SCP in CLI script

Posted: 08 Dec 2015 09:20
by kave_dish
I should clarify - I'm running these commands on a 7750s.