Thank you for the Verbose
log. I have replied to your email with detailed description of the issue and 3 possible ways to solve it. I post my findings here for other visitors.
The issue is caused by the server which uses Telnet over SSH. It is not a standard way to communicate with an SSH server. After establishing SSH connection the server starts using Telnet protocol, which emits various Telnet related data. However, there is no Telnet interpreter on the client side, which results to displaying the "Telnet binary" data on the screen.
Possible solutions:
- Configure your server to not use Telnet (over SSH) if possible.
- Bind
TerminalControl
to Telnet
and use Ssh
as data transport layer.
- Inject into SSH data transport layer and modify traffic as you want (make your own Telnet interpreter).
Sample code for case 2:
var ssh = new Ssh();
ssh.Connect("test.rebex.net", 22);
ssh.Login("demo", "password");
var telnet = new Telnet("-communicates-over-ssh-");
telnet.SetSocketFactory(new SshSocketFactory(ssh));
terminal.Bind(telnet);
Sample code for case 3:
var ssh = new Ssh();
ssh.Connect("test.rebex.net", 22);
ssh.Login("demo", "password");
terminal.Bind(new SshWrapper(ssh));
The codes uses custom classes: SshSocketFactory and SshWrapper.