VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   SSH then telnet (https://forums.vandyke.com/showthread.php?t=10968)

Farhan 03-31-2013 04:12 AM

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

rtb 04-01-2013 07:42 AM

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?

Farhan 04-02-2013 06:11 AM

Its CRT 6.7 and using windows XP

rtb 04-02-2013 11:59 AM

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)?

Farhan 04-03-2013 03:15 AM

Version is Version 6.7.3

I am launching the script by going through menu Script>run>file

rtb 04-03-2013 08:41 AM

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?

Farhan 04-06-2013 01:11 AM

2 Attachment(s)
Here are the snapshot of SSH machine ,I got password prompt then i have to enter it manually

Farhan 04-07-2013 12:51 AM

the snapshot is from my PC to SSH machine

rtb 04-08-2013 10:34 AM

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?

Farhan 04-10-2013 12:42 AM

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

rtb 04-10-2013 08:04 AM

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?


All times are GMT -6. The time now is 12:51 AM.