SCP in CLI script

Post Reply
kave_dish
Member
Posts: 4
Joined: 25 Feb 2013 09:30

SCP in CLI script

Post by kave_dish » 04 Dec 2015 16:27

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?

sadim
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 510
Joined: 02 Jun 2006 07:11
Location: Portugal

Re: SCP in CLI script

Post by sadim » 06 Dec 2015 09:02

Hi,
try: sshpass -p "mypassword" scp filename.dat user@location

Regards

kave_dish
Member
Posts: 4
Joined: 25 Feb 2013 09:30

Re: SCP in CLI script

Post by kave_dish » 07 Dec 2015 13:30

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.

kave_dish
Member
Posts: 4
Joined: 25 Feb 2013 09:30

Re: SCP in CLI script

Post by kave_dish » 08 Dec 2015 09:20

I should clarify - I'm running these commands on a 7750s.

Post Reply

Return to “5620 SAM”