Problem with connecting to another port

Jul 12, 2013 at 3:28 PM
Edited Jul 12, 2013 at 5:52 PM
Hi Everyone,

I am trying to make a simple program written in visual basic 2010. Its purpose is to be able to issue unix commands and display the result. The code below works when I connect to Port 22, but when I changed it to Port 23 (because some machines does not use port 22), and run the program, it will hang and does not respond. I am sure that my connection info is correct.
Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("SvrIP", 22, "Usr", "Pwrd")
Dim sshClient As New Renci.SshNet.SshClient(connInfo)

Dim Fsystem, FreeGB, PerFree As Renci.SshNet.SshCommand

Using sshClient
 sshClient.Connect()
 If sshClient.IsConnected Then
               
  Fsystem = sshClient.RunCommand("df -g |awk '{print $1}'") '("bdf |awk '{print FS_USED $1}'")
   
  lblOut1.Text = Fsystem.Result
 Else
   'some code....
 End If
  sshClient.Disconnect()

End Using
Thank you for taking the time to read, I hope somebody could help...
Jul 12, 2013 at 4:50 PM
This is called SSH.NET not TELNET.NET.
Should be obvious why it does not work :P
Jul 13, 2013 at 2:19 PM
Edited Jul 13, 2013 at 2:20 PM
Hi,

Thank you for letting me know :p. Does it mean, I need another library for connections on port 23 because it handles different protocol? I am new to all of these stuff :p. I think I need to read more before doing the coding part.

Thanks for your reply!!