Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Step-by-Step Configuration and Troubleshooting Best Practices for the NGFW, NGIPS and AMP Technologies A Visual Guide to the Cisco Firepower Threat Defense (FTD)
New Member

how to specify more than one command in plink.exe while SSHing the PIX ?

eg: plink -ssh -m commands.txt somebody@pix.somewhere.com -pw xxx

where commands.txt is:
enable
xxx
show version
logout

which works fine but, is there a way to use something like:

plink -ssh somebody@pix.somewhere.com -pw xxx enable^nxxx^nshow version^nlogout^n

to avoid creating/deleting the associated command file from a batch file (possibly leaving passwords on a temp one) ?

Everyone's tags (3)
1 REPLY
Cisco Employee

Re: how to specify more than one command in plink.exe while SSHi

If you want to do that in a script you would need to have the script parse the output sent back from the ASA in order to send the next command.

You cannot send the commands to the ASA without expecting for the output when you are putting in the enable password on the ASA.

You can use "expect" to do that in Linux.

I hope it helps.

PK

2345
Views
0
Helpful
1
Replies
CreatePlease to create content