# ansible command to reboot host

**URL:** <https://forum.ansible.com/t/ansible-command-to-reboot-host/37811>\
**Category:** Ansible Project\
**Created:** [March 27, 2023, 3:22pm UTC](https://forum.ansible.com/t/ansible-command-to-reboot-host/37811 "2023-03-27T15:22:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [March 27, 2023, 3:22pm UTC](https://forum.ansible.com/t/ansible-command-to-reboot-host/37811/1 "2023-03-27T15:22:55Z")

</div>

I am using follwing command to reboot linux host

ansible -i hosts linux\_vms -a “/sbin/shutdown -r now” -Kk --ssh-extra-args=‘-o StrictHostKeyChecking=no’

but keep getting folowing

Failed to execute operation: Connection timed out

but  
ansible -i hosts linux\_vms -a “uptime” -k --ssh-extra-args=‘-o StrictHostKeyChecking=no’

show the vms are up. any idea?

---

<div class="post-metadata">

**Author:** ![atul\_mohan](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@atul\_mohan](https://forum.ansible.com/u/atul_mohan)\
**Post date:** [August 22, 2023, 4:53am UTC](https://forum.ansible.com/t/ansible-command-to-reboot-host/37811/2 "2023-08-22T04:53:40Z")

</div>

ansible -i hosts linux\_vms -m shell -a “/sbin/shutdown -r now” -u your\_username -K --ssh-extra-args=‘-o StrictHostKeyChecking=no’
