ANSI Characters are not matching in SSH Expected Prompt

I am trying to connect to a Putty server through SSH and executing the commands. I am using SSHConnector Activities package by Sorin Calin, in this I have to pass a command SSH run shell command or SSH run command activity

  1. The issue I am facing when I use SSH Run command activity is, even the I am able to login into Putty Server(with RSA) but Bot can not able to execute the command as the error says: Failed to open a connection with channel after 10 retries. Please help me resolve this
  2. The issue with SSH Run shell command is it has some properties like : Expected Prompt where I should give the regex pattern matching with the last line of the output. Usually, we get a SITE ID in the last line when we manually login into Putty - LAL00360 and run a command
    but when using from SSH , we are getting the response as : e[1mLAL00360e[0m> where the Extra characters are the ANSI Esc codes, bold characters and color codes. Now I have to give a regex pattern which should match with the above mentioned String. I am using : [\x1b[\w>]+ to match the pattern, this is matching the value in regex engine but when i pass the same regex in the activity, it is not matching.

So, how to resolve it! Either I need to make sure that SSH run command works or I need to give regex pattern to match this. Please help me resolve this.


@ Cristian Bidea
Can you please help





@ RaphCh






Can you please resolve this?

I have used SSHConnector.Activities with no issues connecting and executing commands with Linux hosts as destination (never using Putty Server or other kind of SSH server for Windows)

In my case with just setting the following properties in SSH Connect Scope was ok:

  • Timeout (by default)
  • Expected Password Prompt (by default)
  • Host
  • Username
  • Password
  • Port
  • SSH Timeout (by default)

Then a SSH Run Command inside

When I SSH run command, I am facing an issue like : Not able to open a channel after 10 retries, Have you ever faced this issue?


The ANSI characters should be saved in Text file or Config file and read the data from there to pass it into Regex format, If we hardcode the data, it will not work

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.