Skip to content

RunCommand hangs when run agains a cisco SX20 #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
greysun75 opened this issue Sep 29, 2017 · 2 comments
Closed

RunCommand hangs when run agains a cisco SX20 #307

greysun75 opened this issue Sep 29, 2017 · 2 comments
Milestone

Comments

@greysun75
Copy link

I am trying to use SSH.Net to run a command on a cisco SX20. I am able to connect to the endpoint but when it hits the RunCommand line the app freezes. I am able to use PuTTy to run the same command without issue. Any idea where I might be going wrong?

I have been at this for days trying different variations of code but they all seem to hang at the same place, either on RunCommand or .Execute. Here is what I currently have

`private void btnCheck_Click(object sender, EventArgs e)
{
var pass = Encoding.ASCII.GetBytes("mypassword");

    KeyboardInteractiveAuthenticationMethod kauth = new KeyboardInteractiveAuthenticationMethod("myuser");
    kauth.AuthenticationPrompt += new EventHandler<Renci.SshNet.Common.AuthenticationPromptEventArgs>(HandleKeyEvent);

    ConnectionInfo conInfo = new ConnectionInfo("myip", 22, "myuser", kauth);
    using (var client = new SshClient(conInfo))
    {
        try
        {
            client.Connect();
            if (client.IsConnected)
            {
                SshCommand sshCommand = client.RunCommand("xStatus SystemUnit Uptime");
                lblUptime.Text = sshCommand.Result;
                client.Disconnect();
            }
        }
        catch (Exception error)
        {
            string Error = error.Message.ToString();
        }
    }
}`
@WojciechNagorski
Copy link
Collaborator

It's done in #1274

@WojciechNagorski WojciechNagorski added this to the 2023.0.1 milestone Dec 21, 2023
@WojciechNagorski
Copy link
Collaborator

The 2023.0.1 version has been released to Nuget: https://www.nuget.org/packages/SSH.NET/2023.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants