I am currently trying to create a control panel program for my Linux server using Visual Basic and SSH.NET. Right now, I want to restart Linux when I click the button.
Here is what I still have:
Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("IP", "USERNAME", "PASSWORD")
Dim sshClient As New Renci.SshNet.SshClient(connInfo)
Dim cmd As Renci.SshNet.SshCommand
Private Sub MaterialFlatButton1_Click(sender As Object, e As EventArgs) Handles MaterialFlatButton1.Click
Using sshClient
sshClient.Connect()
cmd = sshClient.RunCommand("reboot")
sshClient.Disconnect()
End Using
End Sub
When I click the button, an error appears:
An unhandled exception of type "Renci.SshNet.Common.SshConnectionException" occurred in Renci.SshNet.dll
Additional Information: The established connection was interrupted by software on your host machine.
Is there anything that I will need to change using my code?
source
share