0 votes
by (120 points)

Hello

I am trying to use existing client code to save a rewrite of the client, I need to create a shellstream on the client but i get the error "The pseudo-terminal request was not accepted by the server. Consult the server log for more information."

Is there anything specific i need to set on the client and/or server code for this to work

Many Thanks

by (147k points)
Hello, are you able to create a shell stream to our test server at test.rebex.net? Use "demo" for user name and "password" for password.
by (120 points)
I get the same exception if i connect to test.rebex.net

1 Answer

0 votes
by (147k points)

Rebex SSH server rejects a pseudo-terminal request if the requested number of rows or columns is less than 2 or greater than 999. To prevent the error, make sure to specify values within that range in SSH.NET. For example:

using (var client = new SshClient("test.rebex.net", "demo", "password"))
{
    client.Connect();
    using (var stream = client.CreateShellStream("xterm", 80, 25, 640, 400, 0x10000))
    {
        string response = stream.ReadLine();
        Console.WriteLine($"Response: {response}");
    }
}
...