Is anyone else having an issue with any automation scripts that rely on using SSH to connect to a mikrotik? It seems like when in a pseudo-terminal, line wrap is occurring at around 80 characters.
I went from v7.8 to v7.9 (and v7.9.1). Before, when in a pseudo-terminal, we could send a column width of something above 80 characters. Now, when sending a SSH_MSG_CHANNEL_REQUEST to jump into a pseudo-terminal and sending the pty-req with a larger terminal width, the responses are limited to 80 characters per line.
We also tried changing terminal types to xterm and VT102 from vt100. I’ve also tried sending a terminal width in pixels. Per rfc4254, we’ve also tried sending a window-change after in the pseudo-terminal with a larger terminal width.
We are only using a psuedo-terminal after authenticating because the default banner causes issues with automation.
PHP code we are using is:
#Using version 3.0.19 from https://github.com/phpseclib/phpseclib/releases
$ssh = new \phpseclib3\Net\SSH2(‘SomeIP’);
if ($ssh->login(‘SomeUsername’, ‘SomePassword’)) {
$ssh->setWindowSize(120, 240); //default 80x24
$ssh->enablePTY();
$ssh->exec(‘/ip arp print without-paging’);
$streamResponse = $ssh->read(‘[6n’);
$ssh->disablePTY();
$streamResponse = preg_replace(‘#\x1b[[^A-Za-z]*[A-Za-z]#’, ‘’, $streamResponse);
$streamResponse = substr($streamResponse, 0, -5);
}
It seems related to @jlgonzalez post about v7.9 - http://forum.mikrotik.com/t/v7-9-stable-is-released/166376/242
Put a support ticket in (SUP-117157)