Establishing SSH Connection from Ignition and executing commands & Python

Hey All,
This is the Exact task i need to do with, Though i have tried this with python using the library paramiko,
i was unable to find the way for doing can anyone guide me.

Thanks,
Sri

To run python externally, you need no libraries locally. You need them wherever python will run.

In Ignition, I would use java’s normal classes (starting with ProcessBuilder) to spawn your platform’s ssh executable with suitable parameters (to connect to the remote system and launch your script), with a stream attached to the process’ stdout. Parse/decode that stream to get your result.

Use SSH keys to avoid any prompts while connecting. I recommend arranging for the selected key to only allow running the target script. (A limitation applied to the corresponding line of authorized_keys in the remote system.)

hi @pturmel can you give me any links for example.
Thanks
Sri

I have no sample I can share, sorry. Look at the man-page for ssh and StackOverflow for ProcessBuilder.

ProcessBuilder sample:

1 Like

Thanks @PGriffith,
That worked Fine for me
Regards,
Sri