MarketplaceStudioActivityConnection to SSH Server

Create your first automation in just a few minutes.Try Studio Web

Connection to SSH Server

Connection to SSH Server

by Internal Labs

Star

4

Activity

Downloads

10.2k

Aaron Bloss
Posted 4 years ago

Hi, 

I'm not sure I understand how to use the PrivateKey File Path setting properly for the "SSH Connection Scope" activity.  I have set up an Open SSH file with the private RSA key for the desired linux server connection, however I'm not sure how to reference the needed password in order for the key to get utilized.  How do I input a password for the connected Open SSH file so that my key can be decrypted?  

Error occuring for missing passphrase:  

Source: SSH Connect Scope

Message: Private key is encrypted but passphrase is empty.

Exception Type: Renci.SshNet.Common.SshPassPhraseNullOrEmptyException

Sorin Calin
Posted 4 years ago ago

Unfortunately that option is not implemented. You can fork the code and add the option or you can use a key file without a passphrase.

https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities/blob/0009d72702953704a870db1e954235ac1a4983a9/UiPathTeam.SSHConnector/UiPathTeam.SSHConnector.Activities/Activities/SSHConnectScope.cs#L210

mohan kumar
Posted 4 years ago

Hello Sorin,

I am trying to execute the putty command through SSH connector scope. But I couldn't execute the "awexe node" command and getting error as "bash awaxe command not found". could you please help me to resovle this issue.

Sorin Calin
Posted 4 years ago ago

Unfortunately I cannot help. Please read the documentation carefully and try to use the SSH Run Shell Command Activity. The error clearly indicates the respective command is not known in the shell context you created, so it's not specific to my activity package.

Atmaj Desai
Posted 5 years ago

Hi I am getting below error could you please help 

19.4.5+Branch.support-v2019.4.Sha.83b32374210bfd742f5d3b0ce3267c6c1b86d76e

Source: SSH Connect Scope

Message: Could not load file or assembly 'Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

Exception Type: System.IO.FileLoadException

An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:

System.IO.FileLoadException: Could not load file or assembly 'Renci.SshNet, Version=2016.1.0.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044) ----> System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

   --- End of inner ExceptionDetail stack trace ---

   at UiPathTeam.SSHConnector.Activities.SSHConnectScope.d__65.MoveNext()

   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start\

   at UiPathTeam.SSHConnector.Activities.SSHConnectScope.ExecuteAsync(NativeActivityContext context, CancellationToken cancellationToken)

   at UiPath.Shared.Activities.AsyncTaskNativeImplementation.Execute(NativeActivityContext context, Func`3 onExecute, BookmarkCallback callback)

   at UiPath.Shared.Activities.AsyncTaskNativeActivity.Execute(NativeActivityContext context)

   at UiPath.Shared.Activities.ContinuableAsyncNativeActivity.Execute(NativeActivityContext context)

   at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Sorin Calin
Posted 4 years ago ago

Hi. I'm afraid I can't really help. It seems a specific issue on your machine. I found a few links that could potentially help you investigate:

https://github.com/darkoperator/Posh-SSH/issues/284

https://community.powerbi.com/t5/Desktop/Unable-to-Connect-to-MySQL-database/m-p/756449#M364509

Raju Parashar
Posted 5 years ago

Hello Sorin,

Good evening.

  1. Could you please correct the "SSHTimeout_Description" in your resources file (Resources.resx). The description says "Specifies the amount of time (in milliseconds) to wait for the SSH  specific activity to run before an error is thrown. The default value is  30000 (1 minute)."

  2. Could you please tell why SSH session is getting disconnected when SSHConnectActivity and SSHRunShellCommandActivity are in two separate workflows ?.

 

Currently, the workflow corresponding to SSHRunShellCommandActivity is getting invoked inside SSHConnectActivity. I was expecting that SSH Session will be shared in this case too, but somehow getting errors.

Note: If both these activites are in same workflow, then everything goes fine.

Logs:

Source: Execute Testcase

Message: The activity 'SSH Connect Scope' with ID 34 threw or propagated an exception while being canceled.

Exception Type: System.InvalidOperationException

RemoteException wrapping System.InvalidOperationException: The activity 'SSH Connect Scope' with ID 34 threw or propagated an exception while being canceled.  ---> RemoteException wrapping System.ObjectDisposedException: Cannot access a disposed object.

Object name: 'Renci.SshNet.SshClient'. 

   at Renci.SshNet.BaseClient.CheckDisposed()

   at Renci.SshNet.BaseClient.get_IsConnected()

   at UiPathTeam.SSHConnector.Activities.SSHConnectScope.Cleanup()

   at UiPathTeam.SSHConnector.Activities.SSHConnectScope.OnCompleted(NativeActivityContext context, ActivityInstance completedInstance)

   at System.Activities.Runtime.ActivityCompletionCallbackWrapper.Invoke(NativeActivityContext context, ActivityInstance completedInstance)

   at System.Activities.Runtime.CompletionCallbackWrapper.CompletionWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

--- End of inner exception stack trace ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result)

   at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result)

   at UiPath.Core.Activities.ExecutorInvokeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)

   at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)

   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Sorin Calin
Posted 4 years ago ago

Hi Raju. I'll fix the description message. But for the second part the connection is not automatically passed from the scrope to workflows that you place inside of it. I specifically didn't want to output a connection as a variable from the scope as it would complicate the disposal part. You have the option to programatically create a connection and pass it around as an object to workflows and the subsequent Run Command activities.

See here more details about how to do that programatically and remember to close and dispose the SSHClient afterwards:

https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities/blob/e4f0a9a12f6b925eb6dc224500dbb998147da68e/UiPathTeam.SSHConnector.Tests/TestSSHConnector.cs#L102

Raju Parashar
Posted 5 years ago

Hello Sorin,

Good evening.

Can you please share the documentation of SSHRunShellCommandActivity. It seems the user guide (under resources) doesn't have any reference of the above activity.

Sorin Calin
Posted 5 years ago ago

Hi Raju,

Thanks for pointing it out. I forgot that one. I'll try to make some time and update it, but there's not much more I can add than what's in the Description section. I tried to cover the changes and explain the new functionality there.

Best regards,

Sorin

Chad Williams
Posted 5 years ago

Is there a character limitation built into the Response status?  The responses I'm getting back truncate to a "..."

Is there a way to get more detail back either from a setting in the activity/package, or perhaps a global setting for UiPath?

Sorin Calin
Posted 5 years ago ago

Hi Chad,

There shouldn't be any limitation. If you are using Run Shell Command, maybe the command that you are using is paging the output, and you might have to hit enter to get it to display more. 

You can also try to debug using the source code here: https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities

Best regards,

Sorin

Gustavo Ogueda Reyes
Posted 5 years ago

Dear Sorin,

I posted before and now I could connect without problem Thanks for the reply. Now I am trying to execute the "cd test" command to switch to "test" directory and then use "ls" to get the list of files and directories, but the "cd" command has not worked. It keeps in the root directory. Please Help.

Sorin Calin
Posted 5 years ago ago

You are probably using the SSHRunCommandActivity. 

See in the documentation:

Please note that SSHRunCommandActivity does not use a SSH Shell, so the context is not maintained betweent the commands. To maintain the session, you should utilize SSHRunShellCommandActivity

Gustavo Ogueda Reyes
Posted 5 years ago

Dear Sorin,

I made a free ssh account at https://sdf.org/ to test your component. Apparently the SSH Connect Scope works, but when I tried to run a command (already tried with SSH Run Command and SSH Run Shel Command), an error raises "One or more errors occurred". 

I already tested this connection from PUTTY and works perfectly. At the beginning when I enter my password it  gaves me the next message and I press backspace so then I can execute any command

*

 * Wed Jun  3 23:41:54 UTC 2020

 *

 * For webmail authenication pair, type 'webmail'

 *

[ 'ovatsug' will expire in 665 days - Please 'validate' your account soon ]

Please press your BACKSPACE key:

Please help, I need this working and your component seems to be the solution but I need to figure out how to execute a basic command like ls.

Sorin Calin
Posted 5 years ago ago

Hi,

Check in the logs for the detailed error message. Unfortunately there are many issues that can occur, so it is pretty hard for me to investigate. You can find the code and debug directly on your side here:

https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities

Thanks,

Sorin

Satish Singh
Posted 5 years ago

Hi Sorin,

I tried to connect to one of my Linux servers. But whenever I am trying to use the SSH connect activity it is throwing the error like this: SSH Connect Scope: One or more errors occurred. Kindly help me out in this matter. 

Thank You,

satish

Sorin Calin
Posted 5 years ago ago

If you look in the logs you will probably see the internal exceptions with more details. As you can imagine, I can't understand much from the error message you provided.

You can also use the source code to debug it, if needed: The code for the activity is also public on my GitHub repo:

https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities

Thanks,

Sorin

hema sah
Posted 5 years ago

Hi Sorin, 

I tried SSH connect scope on server A and within the scope I gave ssh command "pwd" in Run SHH Comand activity. I am getting below error, can you please help?

In connection I kept proxy setting blank and mentioned only all SSH settings.

Error:

SSH Connect Scope: Server response does not contain SSH protocol identification.

Sorin Calin
Posted 5 years ago ago

I don't know what it could be. Feel free to debug on your side using the code available here:

https://github.com/sorincalin/UiPathTeam.SSHConnector.Activities

aishwarya meshram
Posted 5 years ago

Hi,

I have my UiPath Studio in local machine and i need to run PuTTy in RDP. Will this activity work? Local machine does not have access to the host which needs to be connected to via SSH the access is only in the RDP. 

Thanks in advance.

Sorin Calin
Posted 5 years ago ago

With the new release that I just uploaded, that should work. You can now utilize a shell as you would by doing it manually, and via that shell you can do additional connections.

Vinodbabu Ganta
Posted 5 years ago

Hi Sorin

I have installed SSH.NET >= 2016.1.0 package but I am unable to see 2 activities: SSHConnectScopeActivity and SSHRunCommandActivity.

I checked under Team also.. No luck..

guide me pls

Sorin Calin
Posted 5 years ago ago

Did you properly download and install the activity package as well?

Publisher

Internal Labs

Visit publisher's page

License & Privacy

License Agreement

Privacy Terms

Technical

Version

2.1.2

Updated

January 9, 2024

Works with

Studio: 21.10 - 23.10

Certification

Silver Certified

Support

UiPath Community Support

Resources