# SSH command from CoDeSys

**URL:** <https://www.wago.community/t/ssh-command-from-codesys/1048>\
**Category:** CODESYS\
**Created:** [June 24, 2024, 8:04am UTC](https://www.wago.community/t/ssh-command-from-codesys/1048 "2024-06-24T08:04:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjornidar](https://avatars.discourse-cdn.com/v4/letter/b/5fc32e/32.png) [@bjornidar](https://www.wago.community/u/bjornidar)\
**Post date:** [June 24, 2024, 8:04am UTC](https://www.wago.community/t/ssh-command-from-codesys/1048/1 "2024-06-24T08:04:01Z")

</div>

Hi,

is there an existing library to execute SSH-commands from CS runtime software?  
I’d like to reboot a Linux host from the Wago PLC.

---

<div class="post-metadata">

**Author:** ![quenorha](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/quenorha/32/429_2.png) [@quenorha](https://www.wago.community/u/quenorha)\
**Post date:** [June 24, 2024, 8:16am UTC](https://www.wago.community/t/ssh-command-from-codesys/1048/2 "2024-06-24T08:16:40Z")

</div>

I don’t think so. But you could create a script in order to do that, place it in /etc/config-tools folder, make it executable (chmod +x) and then call the script using WagoAppConfigtool library

---

<div class="post-metadata">

**Author:** ![TomasD](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/tomasd/32/2042_2.png) [@TomasD](https://www.wago.community/u/TomasD)\
**Post date:** [June 24, 2024, 11:10am UTC](https://www.wago.community/t/ssh-command-from-codesys/1048/3 "2024-06-24T11:10:08Z")

</div>

FbSetSshConfig and FbGetSshConfig are apparently the same libraries?  
I don’t see the command being called, let’s say asking for the temperature “vcgencmd measure\_temp”?

---

<div class="post-metadata">

**Author:** ![WagoDamRud](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/wagodamrud/32/258_2.png) [@WagoDamRud](https://www.wago.community/u/WagoDamRud)\
**Post date:** [June 26, 2024, 11:03am UTC](https://www.wago.community/t/ssh-command-from-codesys/1048/4 "2024-06-26T11:03:53Z")

</div>

there are 2 ways to call linux commands.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/84e518c0f2b8332db72d93baf2fdf33cc79dc666.jpeg)

_WagoAppConfigTool_ works smart, because it creates sub task in the background and monitor PID if it is done, so it doesn’t block runtime. In this library you can call _./start\_reboot_ script to reboot controller.

Second possibility is to use codesys _SysProcess_ library (function `SysProcessExecuteCommand2` in sublibrary _SysProcess Implementation_). This way you can call directly you command. But be aware, that it creates subprocess from called task, so **the task stops untill it returns value**. so this way is better to call from separate task with lowest priority.
