.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

run ssh commnads using plink.exe and vb.net

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net
 

I am trying to automatically run ssh  commands to linux server from my local machine, usng asp.net page.

I have created a key pair using puttygen and ask network administrator to authenticate key in server. then i try this code in my page.

 

        Dim p As New Process
        Dim si As New ProcessStartInfo
        Dim read As System.IO.StreamReader = Nothing

        si.Arguments = "plink -ssh connectremote -l testuser"
        si.FileName = "C:/my stuff/plink.exe"
        si.CreateNoWindow = True
        p.StartInfo = si

        Try
            p.Start()
            read = p.StandardOutput
            lblMsg.Text = read.ReadToEnd()

        Catch ex As Exception
            lblMsg.Text = ex.ToString()
        End Try


 

this code set to button click and once click the buttin it prompt console and I cannot do any thing.

how should i solve this problem

 

Actually i need to run few commands from back end , like first one to login using saved session in putty , and then su command to change substitute user  then cd to go to a directory and from there run some commands define in that server

and then i need to know the out put

how do i do these all in one button click with any window prompt

plaese help me or direct


View Complete Post


More Related Resource Links

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend