Link to home
Start Free TrialLog in
Avatar of grjitdept
grjitdept

asked on

Automating a login and single command to my firewall using Putty/Plink OR Telnet?

Hi,

I need to write a script that connects to my firewall (a Netscreen 25) and sends it a single command (a manual DNS refresh). I've been guided so far to use Putty/Plink, but have got stuck about how to proceed.

I plan to connect using SSH or Telnet protocol. Using SSH with plink, I can pass the username and password and hostname as parameters in the command line, but also want to pass a single command as well, e.g.

plink -ssh HOSTNAME - l LOGIN - pw PASSWORD     .......SINGLE LINE COMMAND HERE....

My question is, is this possible? Or do I haave to get into the realms of linking to external files of commands, or automating a session using putty etc? I'm after a simple quick solution for this!

Thanks
Avatar of sardiskan
sardiskan
Flag of United States of America image

What exactly are you trying to do, just update your DNS in your firewall?
Avatar of grjitdept
grjitdept

ASKER

Yeah the Netscreen DNS refreshs once every 4 hours at fastest, and  we use quite a few dynamicDNS alises that change regularly and we can't wait 4 hours for the firewall to pickup the new IP addresses!
ASKER CERTIFIED SOLUTION
Avatar of Darkstriker69
Darkstriker69

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys - both answers look good...

DarkStriker - I've tried your script and it works perfectly! Thanks for that - also some useful techniques in there for future applications.

Many thanks