# How to issue shell command from tmsh?

**URL:** <https://community.f5.com/t/how-to-issue-shell-command-from-tmsh/54090>\
**Category:** Technical Forums\
**Tags:** tmsh, tmos, devops, application-delivery\
**Created:** [October 26, 2018, 2:24am UTC](https://community.f5.com/t/how-to-issue-shell-command-from-tmsh/54090 "2018-10-26T02:24:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankur\_Mathur](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Ankur\_Mathur](https://community.f5.com/u/Ankur_Mathur)\
**Post date:** [October 26, 2018, 2:24am UTC](https://community.f5.com/t/how-to-issue-shell-command-from-tmsh/54090/1 "2018-10-26T02:24:50Z")

</div>

I am trying to automate f5 using ansible and need way to fetch and put back the masterkey. The master key fetching is done by command “f5mku -K” which gets executed on native shell. How can i execute this command from tmsh? Ansible command modules by default use tmsh hence the requirement.

---

<div class="post-metadata">

**Author:** ![Ankur\_Mathur](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Ankur\_Mathur](https://community.f5.com/u/Ankur_Mathur)\
**Post date:** [October 26, 2018, 2:35am UTC](https://community.f5.com/t/how-to-issue-shell-command-from-tmsh/54090/2 "2018-10-26T02:35:08Z")

</div>

Alternatively, way to fetch and apply the master key from the tmsh will also help.

---

<div class="post-metadata">

**Author:** ![Ankur\_Mathur](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Ankur\_Mathur](https://community.f5.com/u/Ankur_Mathur)\
**Post date:** [October 26, 2018, 2:54am UTC](https://community.f5.com/t/how-to-issue-shell-command-from-tmsh/54090/3 "2018-10-26T02:54:27Z")

</div>

We can use the following option:

run /util bash -c “f5mku -K”
