No Results from Commands

Feb 9, 2012 at 3:15 AM
Edited Feb 9, 2012 at 3:15 AM

Hey All,

Firstly thanks a bunch Oleg for this library!!!

Currently having an issue where I am not seeing any results from commands being run in my ssh session.

Here is my current code (snippet) from VB.NET 2010:

 

Using SSH_client = New SshClient(HostAddress, CurrentUser, New PrivateKeyFile(File.OpenRead(SSH_Key), TempPassword))
           
    SSH_client.Connect()

    Dim Command2Exec = SSH_client.CreateCommand("ls")
    Command2Exec.Execute()   
   
    Dim ResultsReader = Command2Exec.OutputStream
    Console.WriteLine(vbCrLf & "Results: " & Command2Exec.Result)
    Console.WriteLine(vbCrLf & "Results: " & ResultsReader)
   
    Command2Exec.Execute("ls")
    Console.WriteLine(vbCrLf & "Results: " & Command2Exec.Result)
   
    Dim test = SSH_client.RunCommand("ls")
    Console.WriteLine(vbCrLf & "Results: " & test.Results)
   
    SSH_client.Disconnect()
   
End Using

 


It seems that it is connecting correctly:

Ssh_Client.IsConnected = True
SSh_Client.ServerVersion = "SSH-2.0-OpenSSH_4.3"

 

From an executed command:

Command2Exec.CommandText = "ls"
Command2Exec.Error = ""
Command2Exec.ExitStatus = 0
Command2Exec.Result = ""

 

Any and all help would be greatly appreciated!

-DoW

Feb 10, 2012 at 12:26 AM

Good news!

So it appears it is connecting properly, however my problem now is that it appears the server requires extra authentication.

Even though i am providing the privatekey and password i am getting an error that states:

        "Pseudo-terminal will not be allocated because stdin is not a terminal.  Permission denied (publickey)."

Tried using the Shell method as well, which connects however does not send any other commands after connecting.

Does anyone have a fully implemented/working version using the Shell method in VB.Net (or even C#)?

Thanks a bunch, much appreciated!