Unable to integrate Putty using SSH Connection

Hi Forum,

I was trying to integrate putty using UiPathTeam.SSHConnector.activities, I have passed all the values in SSH Connector Scope except passprase key for that particular private key as i don’t find the option in the properties.

Could anyone suggest how i can make the option enabled, as i don’t have good knowledge on C# to overwrite the source code,

Also please suggest any other way for putty integration if possible.
@Sorin_Calin

1. Verify the Package Version

Ensure you are using the latest version of the UiPathTeam.SSHConnector.activities package. Developers may have addressed the issue in recent updates.

  • Open Manage Packages in UiPath Studio.
  • Check for updates to the UiPathTeam.SSHConnector.activities package.

2. Use OpenSSH with Command Line

You can use the plink or ssh command-line utilities instead of the SSH Connector activities. These utilities allow you to specify a private key and passphrase.

  1. Generate the Required Command:

bash

Copy code

ssh -i /path/to/private/key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no username@hostname

Adjust the path and options as needed.
2. Integrate with UiPath:

  • Use the Invoke PowerShell or Start Process activity in UiPath to run the SSH commands.

3. Custom Script with a Third-Party Library

If you’re open to scripting:

  • Use Python with libraries like paramiko.
  • Write a script to handle SSH connections and passphrase management.
  • Call the script from UiPath using the Python Scope or Invoke Code activities.

Example in Python (using paramiko):

python

Copy code

import paramiko

def connect_with_passphrase(host, port, username, private_key_path, passphrase):
    key = paramiko.RSAKey.from_private_key_file(private_key_path, password=passphrase)
    client = paramiko.SSHClient()
    client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    client.connect(hostname=host, port=port, username=username, pkey=key)
    stdin, stdout, stderr = client.exec_command('ls')
    print(stdout.read().decode())
    client.close()

Pass the necessary parameters from UiPath to the script.


4. Consider Alternative SSH Libraries

If you need a more comprehensive solution:

  • Use the Renci.SshNet library in a custom C# implementation. Although you mentioned limited C# knowledge, this approach may provide full control over SSH features.
  • Hire a developer or collaborate with someone to create a reusable library activity.