本文介绍了SSH命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我试图通过ssh发送2个命令但是你成功了。

Hello, im trying to send 2 commands via ssh but withou success.

我需要发送:

" configure终端"

"configure terminal"

" users"

"users"

如果通过putty发送此命令,则该命令正常工作但我无法用VB实现。

This commands are working if is sended via putty but i cannot make it with VB.

Private Sub bt_update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_update.Click
        Dim connInfo As New Renci.SshNet.PasswordConnectionInfo("111.111.1.1", TextBox1.Text, TextBox2.Text)
        Dim sshClient As New Renci.SshNet.SshClient(connInfo)
        Dim cmd As Renci.SshNet.SshCommand


        Using sshClient
            sshClient.Connect()

            cmd = sshClient.RunCommand("configure terminal")
            cmd = sshClient.RunCommand("users")

            sshClient.Disconnect()
        End Using
    End Sub


someone能够帮帮我?

Someone can help me?

推荐答案


这篇关于SSH命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-10 21:32