# Python/Java Library for SSH from Ignition to SSH server computer to run a script

**URL:** <https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [July 30, 2021, 9:53pm UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420 "2021-07-30T21:53:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![besaliealprince](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@besaliealprince](https://forum.inductiveautomation.com/u/besaliealprince)\
**Post date:** [July 30, 2021, 9:53pm UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420/1 "2021-07-30T21:53:14Z")

</div>

Working on the an application where when I press a button on Ignition, I need the the action to establish a SSH connection to the remote server and run a python script and also get a return value.

ParaMiko is a python library and has a lot of Dependencies which I am assuming wont work in Jython [I haven’t tried it]

Wanted to get some guidance on what would be the best option to execute this application ?  
Are there any other libraries in python I could use since I am not a java programmer ?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 30, 2021, 10:08pm UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420/2 "2021-07-30T22:08:33Z")

</div>

Well… you could write your Python application entirely stand alone, and then either system.util.execute (or one of the alternatives from Java or Python stdlib) or expose a web service endpoint on localhost that you trigger via an HTTP call from Ignition.

---

<div class="post-metadata">

**Author:** ![besaliealprince](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@besaliealprince](https://forum.inductiveautomation.com/u/besaliealprince)\
**Post date:** [August 2, 2021, 4:14pm UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420/3 "2021-08-02T16:14:14Z")

</div>

Ended up using the system.util.execute to ssh tunnel through a shell script and execute the py shell along with the py script on the remote computer.  
system.util.execute - doesn’t have a return value if the script was successfully executed or not, looking into alternate methods to find a work around.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 2, 2021, 4:15pm UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420/4 "2021-08-02T16:15:11Z")

</div>

> [@besaliealprince](#):
>
> system.util.execute - doesn’t have a return value if the script was successfully executed or not, looking into alternate methods to find a work around.

Both the Java and Python stdlib alternatives do return status and output.

See [Procedure for installing python libraries from source - #18 by Kevin.Herron](https://forum.inductiveautomation.com/t/procedure-for-installing-python-libraries-from-source/26022/18) for an example.

also [https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Process.html#exitValue()](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Process.html#exitValue())

---

<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:** [August 3, 2021, 11:28am UTC](https://forum.inductiveautomation.com/t/python-java-library-for-ssh-from-ignition-to-ssh-server-computer-to-run-a-script/49420/5 "2021-08-03T11:28:38Z")

</div>

Pssst! Use the Java Process library.
