Create your first automation in just a few minutes.Try Studio Web →
by Internal Labs
4
Activity
10.2k
Hi Sorin Calin.
I want to execute the command "sudo su", and I'm struggling with what to put as "Shell Expected Prompt".
If I write "#", the Activity shows:
Run SSH command: Ssh error: Timeout 30s executing sudo su
Expected Regex: #
Received text: sudo su
, code: exception, command: sudo su
I'm using the version 2.1.2
In the old Windows-legacy it was working fine.
Do you have any ideas what to put in "Shell Expected Prompt"?
Thanks.
We are getting the error SSH Connect Scope: Exception has been thrown by the target of an invocation. when establishing the connection. Any ideas on what would cause this? We can make the connection with SSH through commandline, but UIPath fails.
Thanks,
Chad Joubert
I can't be able to import this package when i create the workflow in Windows version, its only allowing me to install the package if i select windows legacy but this is not recommendable as the windows legacy is going to be discontinued soon, How to resolve this?
I am unable to locate the user guide. the only thing I see available is what is in the description of the github repro and the overview here.
github:
"Custom UiPath Activities that allow for creation of an SSH connection and running commands inside it.
Summary
Allows establishing an SSH connection and sending commands.
Benefits
Useful for dealing with UNIX systems that expose an SSH endpoint.
Package specifications
Contains three custom activities that facilitate establishing an SSH connection and sending commands through it.
SSHConnectionScopeActivity
SSHRunCommandActivity
SSHRunShellCommandActivity
Dependencies
SSH.NET >= 2020.0.0
Installation guide
Install the UiPathTeam.SSHConnector.Activities.x.x.x.x.nupkg using the UiPath Package Manager"
where can i find the more indepth documentation?
Please read the Overview and also have a look through the questions here. I don't plan on adding any more in-depth documentation.
az login command does not work with SSH Run Command.,Can you please help?
You probably need to use the SSH Run Shell Command activity as I imagine you will need to run more commands in the same context after the login. Please check the description and the previous questions to overcome challenges regarding the "Expected Prompt".
Sorin Calin Thank you very much for help.
Maybe someone will need it:
A reply to the prompt:
If, after logging in, we see: #
just enter in Regex: '#'
If, after logging in, we see, for example: cos
itm02: ~ $
just enter in Regex: '[a-zA-Z0-9 _.-] *
[a-zA-Z0-9 _.-] *: ~ $'
It works like this
I'm glad you managed to make it work.
Using just "#" in your regex is risky, as it will wrongfully match any such character that you might find in the output of a command. You have to make the regex as specific as possible.
Hi,
How to connect to another HOST on an early connection?
This next host can only be accessed from first host. Eg. when putty is connected to it (first host) then i connect second host.
When I connect putty on 1 host I use the command: sshpass -p 'my_pass' ssh login@10.14.3.10
How to connect with Connection to SSH Server?
Any other ways?
What does it do ?
It is possible ?
What are they for:
- SSH Run Command
- SSH Run Shell Command
How to use them?
What are the differences betwen them?
What are they for:
- Shell Stream
- Shell Expected Prompt
How to use them?
I am asking for an example
thx
Hi,
You need to do the following steps:
1. Use SSH Connect Scope activity to establish a connection to the first server. You must use an expected Shell Prompt so it will create a Shell to run further commands in
2. Inside the SSH Connect Scope, you must run the SSH Run Shell Command to make the connection to the second server. You might have to change the "Expected Prompt" on this one according to the prompt that you will get after the second connection is established
3. Run any subsequent commands inside the SSH Connect Scope activity using SSH Run Shell Command and using the proper expected prompt
Please read the Overview of this package which will explain what the Shell Prompt is. In short, the "Shell" is a session in which you can run commands and read the output. The output is read until you get the "prompt", like in the Windows Shell (CMD) where it's usually "c:\myFolder>". Run Command does not use a shell, so there is no "session" stored between the commands that you send over it, so you can't use it for you situation. The Expected Prompt setting is given as a Regex expression that has to match the prompt of your SSH server's shell output.
I hope this helps.
Best regards,
Sorin
I'm trying to automate a user creation workflow and it seems that when i run a command for it, the system is asking again for the admin password. how can i send that password in a secure way? I get the credentials using "Get Credentials". In the "SSH Run Shell Command" activity, the Command input is a string without any option of using secure string.
Thank you!
Hi Claudiu,
You can programatically convert the secure string to a string using:
new System.Net.NetworkCredential("", SecureStringPassword).Password
Also, considering you're using the "Shell" option, please pay attention to the prompt after running the command. If the prompt format changes (for example xyz@server:// to admin@server://) you might have to use a new Regex for it in the SSH Run Shell Command.
Good luck!
Sorin
presra --execute "select msc_caller_number,count(msc_called_number) as count_called_number,count(distinct(msc_called_number)) as distinct_called_number,count(distinct(msc_geographic_position)) as distinct_cellsite,count(distinct(msc_imsi)) as distinct_imsi,sum(msc_duration) as sum_dur from u_l_msc where msc_fm_call_type in (1,2) and msc_recordtype = 1 and msc_service_type = 1 and partition_col= current_date - interval '1' day and msc_called_number not like '+2661%' group by msc_caller_number having (count(distinct msc_called_number)/count(msc_called_number)) > 0.90 and count(msc_called_number) > 10 and count(distinct(msc_geographic_position)) data.csv &
this command is executing from unix prompt but when using through SSH Run Command creating file of 0 size. Not undersatnding why this is happening
Exit code = 126
Please give an absolute path to the output file or try using SSH Run Shell Command.
What is the difference between SSH Run Shell Command and SSH Run Command. As I m able to run echo hello world from SSH Run Command activity but getting error in SSH Run Shell Command: SSH Run Shell Command: Ssh error: Object reference not set to an instance of an object., code: exception, command: echo hello world
You probably did not set the Shell Expected Prompt for the SSH Connect Scope activity. If that's not set, then the shell is not created, so SSH Run Shell Command will not have the Shell object to work with.
You'll have to set a Regex expression that matches the prompt of your particular SSH Server. As an example: "[a-zA-Z0-9_.-]*@[a-zA-Z0-9_.-]*:\~.*\$ $"
does this connector support the "runjobs" command?
I get an error - "SSH Run Shell Command: Ssh error: Object reference not set to an instance of an object., Code: exception, command: runjobs STOPMPSLSN ENDDAY"
Run Shell command can only be used if you have set the Expected Shell Prompt in the SSH Connect activity. If that's not set there will be no Shell created, hence the Run Shell Command will not have a shell to work in.
Sorin,
I am attempting to use your package for my project. The SSH Connect Scope works fine, but when I try to use SSH Run Command, it says "Could not generate view for SSHRunCommand." Do you know why it may be doing this?
Technical
Version
2.1.2Updated
January 9, 2024Works with
Studio: 21.10 - 23.10
Certification
Silver Certified
Support
UiPath Community Support
Resources