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 03-31-2013, 05:12 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
SSH then telnet

My task is to SSH one server and telnet to one equipment .


I make SSH script and it is working but having problem that I have to press enter manually when script enter the password

Also after that I want to telnet to another machine from that SSH server

Here is my SSH Script

# $language = "VBScript"
# $interface = "1.0"

' Connect to an SSH server using the SSH2 protocol. Specify the
' username and password and hostname on the command line as well as
' some SSH2 protocol specific options.

Sub Main

Dim host
host = "10.245.138.200"
Dim user
user = "tss123"

' Prompt for a password instead of embedding it in a script...
'
Dim passwd
passwd = crt.Dialog.Prompt("Enter password for " & host, "login", "tss123ux", True)

' Build a command-line string to pass to the Connect method.
'
cmd = "/SSH2 /L " & user & " /PASSWORD " & passwd & " /C 3DES /M MD5 " & host



crt.Session.Connect cmd

End Sub
Reply With Quote
  #2  
Old 04-01-2013, 08:42 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi Farhan,

Thanks for the question. What version of SecureCRT are you using?

What operating system are you using?

How are you launching the script you have written?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 04-02-2013, 07:11 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
Its CRT 6.7 and using windows XP
Reply With Quote
  #4  
Old 04-02-2013, 12:59 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi Farhan,

Thanks for the information. Are you using SecureCRT 6.7.1, 6.7.2, etc.?

How are you launching the script you are using (e.g. command-line using /script, Script menu, Login script)?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #5  
Old 04-03-2013, 04:15 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
Version is Version 6.7.3

I am launching the script by going through menu Script>run>file
Reply With Quote
  #6  
Old 04-03-2013, 09:41 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi Faran,
Quote:
I make SSH script and it is working but having problem that I have to press enter manually when script enter the password
I have not been able to reproduce any issue using your script code, Windows XP SP3 and SecureCRT 6.7.3. Would you be able to post a screenshot of the actual issue?
Quote:
Also after that I want to telnet to another machine from that SSH server
Does the machine to which you are connecting have a Telnet client?

If so, you will just need to enable Synchronous after connecting, use WaitForString() to wait for the prompt, and then use Send() to send the command to Telnet to the remote machine.

Does this help?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #7  
Old 04-06-2013, 02:11 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
Here are the snapshot of SSH machine ,I got password prompt then i have to enter it manually
Attached Images
File Type: jpg 10.245.138.jpg (27.5 KB, 491 views)
File Type: jpg pass.jpg (23.5 KB, 404 views)
Reply With Quote
  #8  
Old 04-07-2013, 01:51 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
the snapshot is from my PC to SSH machine
Reply With Quote
  #9  
Old 04-08-2013, 11:34 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi Farhan,

Thanks for the screenshots. The screenshot with the name of pass.jpg appears to be the dialog you are creating. Is there something wrong with this dialog that is being generated?

If not, can you provide more details about the actual issue?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #10  
Old 04-10-2013, 01:42 AM
Farhan Farhan is offline
Registered User
 
Join Date: Apr 2007
Posts: 14
The issue is I do not want to press enter every time i run the script , When i runt the script it goes to SSH and prompt for the password
Reply With Quote
  #11  
Old 04-10-2013, 09:04 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,305
Hi Farhan,

I have seen something similar to this issue in the recent past. It seems like you might have the saving of passwords administratively disabled. If this is the case, then you should be able to resolve the issue by installing SecureCRT 7.1 beta. You can currently download a copy of 7.1b3 from the following location:
http://www.vandyke.com/download/securecrt/beta.html
Would you test this version of SecureCRT and let me know if you still see the issue?
__________________
--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 08:32 AM.