Skip to content
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

Error Not Handled for Request Type: connectByUsername #55

Open
mmsyamsurrijal opened this issue Jul 23, 2023 · 3 comments
Open

Error Not Handled for Request Type: connectByUsername #55

mmsyamsurrijal opened this issue Jul 23, 2023 · 3 comments

Comments

@mmsyamsurrijal
Copy link

Hello.. I keep getting error "MTS\Common\Devices\Actions\Remote\Connections\Ssh::connectByUsernameFromLinux>> Not Handled for Request Type: connectByUsername" when i tried to connect SSH by username. Would you please help me?

@merlinthemagic
Copy link
Owner

Hi,

What are OS and SSH implementation are you connecting to?

Also MTS is not maintained, but MTM-SSH is.

MTM-SSH is far more stable, API is almost the same (see documentation), its Linux only, but given you are connecting from a Linux host that works. Try it,

@mmsyamsurrijal
Copy link
Author

mmsyamsurrijal commented Jul 25, 2023

Hi, thanks for your response..

I've tried MTM-SSH and it works. Can I use this to connect to network router with various platform (ex: cisco, huawei, zte, nokia, etc)?

Because I've got error when I tried to get a remote shell on a linux server using an existing shell (using jumphost server to connect to network router). I got exception "Shell was terminated" on rawRead function when execute getDestinationShell.

@merlinthemagic
Copy link
Owner

Hi @mmsyamsurrijal,

MTM-SSH has 99% parity with the underlying shell. There are sometimes issues sending control sequences as they are non-printable. But generally I have not yet had an instance where it failed to connect to another linux box.

As for different routers and other network devices. Regarding the "Shell was terminated" error, chances are the shell type on the device you are connection to is unknown to MTM-SSH and it is likely you need to write a shell class for each type if they are not just a standard bash shell.
This is because we need to establish what will act as a delimiter each time we build on the shell. If we dont have that we dont know if a command finished or if we should wait longer.

As an example see here for Mikrotik RouterOS.

In addition, once you connect a shell, the terminal you end up with might change (x-term, vt100 etc). Again see the mess of terminal breaks when parsing RouterOS returns.

Hats off to programs like Putty for handling all these cases as well as it does.

You can check the stdout piped data by starting a shell. inset a sleep(5), then execute the following on the command line:

tail -f /dev/shm/6*/stdOut

Then see the commands get executed and their return.

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