# Establishing SSH Connection from Ignition and executing commands & Python

**URL:** <https://forum.inductiveautomation.com/t/establishing-ssh-connection-from-ignition-and-executing-commands-python/60397>\
**Category:** Ignition\
**Created:** [June 6, 2022, 1:03pm UTC](https://forum.inductiveautomation.com/t/establishing-ssh-connection-from-ignition-and-executing-commands-python/60397 "2022-06-06T13:03:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 6, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/establishing-ssh-connection-from-ignition-and-executing-commands-python/60397/2 "2022-06-06T13:30:03Z")

</div>

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](https://docs.oracle.com/javase/8/docs/api/java/lang/ProcessBuilder.html)) 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.)

---

_[View the full topic](https://forum.inductiveautomation.com/t/establishing-ssh-connection-from-ignition-and-executing-commands-python/60397)._
