Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-14-2011, 01:12 AM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Question How to connect in script using a firewall

Hi,
My version is 5.5, I have a firewall settings named "MyFirewall" in global options, how can I specify it in my script? Or can I specify the firewall settings instead of the firewall name?

I'v tried the following ways, but didn't work...
  1. firewall in script
    start.bat
    Code:
    SecureCRT.EXE /SCRIPT script.js
    script.js
    Code:
    ...
    crt.session.ConnectInTab("/FIREWALL /SSH2 /ACCEPTHOSTKEYS /L .. /PASSWORD .. /P .. MyIP")
    ...
  2. firewall in command
    start.bat
    Code:
    SecureCRT.EXE /FIREWALL /SCRIPT script.js
    script.js
    Code:
    ...
    crt.session.ConnectInTab("/SSH2 /ACCEPTHOSTKEYS /L .. /PASSWORD .. /P .. MyIP")
    ...

Thanks for help.
ss
Reply With Quote
  #2  
Old 04-14-2011, 08:20 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi seesea,

Thanks for the question. This is a known issue in SecureCRT 5.5. You should be able to accomplish your goal by upgrading to SecureCRT 6.0.3 or newer.

If you need to use multiple firewalls, then you would need to use pre-defined sessions in your script. If you do not need to use multiple firewalls, then you could define the firewall for the Default Session and use the ad hoc sessions that you appear to be using.

Does this help resolve the issue?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 04-17-2011, 09:24 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Quote:
Originally Posted by rtb
Hi seesea,

Thanks for the question. This is a known issue in SecureCRT 5.5. You should be able to accomplish your goal by upgrading to SecureCRT 6.0.3 or newer.

If you need to use multiple firewalls, then you would need to use pre-defined sessions in your script. If you do not need to use multiple firewalls, then you could define the firewall for the Default Session and use the ad hoc sessions that you appear to be using.

Does this help resolve the issue?
Thank you Todd,before your note I'd tried those two ways and both worked. I can't add my process for the issue wasn't shown then.
Thanks again.
Reply With Quote
  #4  
Old 04-18-2011, 07:37 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi seesea,

Thanks for the update. I am glad to hear that you found a solution to the issue.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 04-19-2011, 01:33 AM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Hi Todd, Sorry troubling you again, I got a little trouble: I can't specified the /SSH2 /ACCEPTHOSTKEYS options when I using the pre-defined sessions.

And another question I'd post in this issue.

Thanks for your help!
ss
Reply With Quote
  #6  
Old 04-19-2011, 07:52 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi seesea,

Thanks for the question. You do not need to specify /SSH2 when using a pre-defined session. This setting should be defined in the session already.

I would recommend connecting to the remote host manually prior to using the script. This will populate the hostkey database eliminating the need to use /ACCEPTHOSTKEYS.

Does this help?

Another option would be to upgrade SecureCRT which would allow you to use a firewall with ad hoc sessions.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 04-19-2011, 08:59 PM
seesea's Avatar
seesea seesea is offline
Registered User
 
Join Date: Jun 2010
Posts: 20
Thank you Todd, while opening the "connect" dialog is a bit slow for I have thousands of sessions saved, so I created some scripts for help. Then it doesn't matter that manually close the accept hostkeys dialog, only sometimes.
Thanks again for all your help.
ss
Reply With Quote
  #8  
Old 04-20-2011, 11:18 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi seesea,

Thanks for the update. I am happy to help. Please let us know if you have any additional questions.
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 07:06 PM.