Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / April 2006



Tip: Looking for answers? Try searching our database.

Sending commands to SSH

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lawsan - 28 Apr 2006 01:03 GMT
I am trying to create a form that will send commands to a telnet session.
This session is a PuTTY SSH session. I can start PuTTY with a Shell
function. How does one associate the running telnet session the the command
buttons. Should I use:

Dim Putty As Object

in some way and then Set it?

Set Putty = CreateOject("Putty.exe")

Putty is not an ActiveX component.
Below is my code. Can someone please help me understand how to blend the
command buttons to the running PuTTY session? I appreciate it. ...Mike

Private Sub CommandButton1_Click()
'this shell command starts a SSH telnet session
'I want to issue commands from the command button below
Shell "c:\putty\PUTTY.EXE"
End Sub

Private Sub CommandButton2_Click()
Dim cell As String
cell = TextBox1.Text

'Here is where I want to send text, then the cell variable, then more text
'Is it SendKeys? Or Print. In the form of Something.Sendkeys "Text" & cell &
"more text"  ?

End Sub
Brian Doyle - 28 Apr 2006 09:36 GMT
I'm not sure what you are trying to achieve but if it is that you want to
run a command on another server via PUTTY then you should really be looking
at PLINK instead.

Using PUTTY will open up a terminal session in the dos window and I am sure
you can't then send it more stuff.
If you are trying to run commands depending situations then you may need to
set up scripts in the home directory of the session your login on with in
PUTTY and calling them using PLINK, ie

Shell "c:\plink.exe -l username -pw password servername scriptname"
or
Shell "c:\plink.exe -l somebody -pw password 10.0.0.1
/home/somebody/bin/ls -l > /home/somebody/x.x"

this will do the same as loggin onto the server and running the script and
plink can be run without the dos window.

> I am trying to create a form that will send commands to a telnet session.
> This session is a PuTTY SSH session. I can start PuTTY with a Shell
[quoted text clipped - 26 lines]
>
> End Sub
Lawsan - 28 Apr 2006 16:06 GMT
I did not know that the PuTTY session window is actually a dos window. Is a
dos window an ActiveX component? I need the PuTTY window open and I want a
separate userform with one textbox to enter a string variable and then some
command buttons that will send text along with the variable to the open
PuTTY window. I also want to send a carriage return (^M) at the end of the
text/variable string. I appreciate the response.
> I'm not sure what you are trying to achieve but if it is that you want to
> run a command on another server via PUTTY then you should really be
[quoted text clipped - 51 lines]
>>
>> End Sub
Mike - 28 Apr 2006 18:27 GMT
>Shell "c:\plink.exe -l username -pw password servername scriptname"
>or
>Shell "c:\plink.exe -l somebody -pw password 10.0.0.1
>/home/somebody/bin/ls -l > /home/somebody/x.x"

Kind of defeats the purpose of ssh (secure shell) doesn't it!
Signature

Mike

Matthew Connor - 28 Apr 2006 19:36 GMT
Mabry has an ActiveX control that does this. It works pretty well.

http://www.mabry.com/telnetx/index.htm
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.