# Disable SSH via provisioner

**URL:** <https://discuss.hashicorp.com/t/disable-ssh-via-provisioner/35942>\
**Category:** Packer\
**Created:** [February 18, 2022, 1:39pm UTC](https://discuss.hashicorp.com/t/disable-ssh-via-provisioner/35942 "2022-02-18T13:39:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.felding](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/e.felding/32/25997_2.png) [@e.felding](https://discuss.hashicorp.com/u/e.felding)\
**Post date:** [February 18, 2022, 1:39pm UTC](https://discuss.hashicorp.com/t/disable-ssh-via-provisioner/35942/1 "2022-02-18T13:39:43Z")

</div>

Im using Packer to deploy a firewall and after deployment I want to disable SSH. I’ve tested using a provisioner but I get an error when to the connection drops. How do I handle this error?

---

<div class="post-metadata">

**Author:** ![brucellino1](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/brucellino1/32/16147_2.png) [@brucellino1](https://discuss.hashicorp.com/u/brucellino1)\
**Post date:** [February 18, 2022, 2:19pm UTC](https://discuss.hashicorp.com/t/disable-ssh-via-provisioner/35942/2 "2022-02-18T14:19:15Z")

</div>

It comes as no surprise that the connection drops after you disable ssh, since Packer is probably using the SSH [communicator](https://www.packer.io/docs/communicators) to provision the machine.

The way I understand it, unless you

1. use another communicator to apply the configuration
2. delay application of the firewall until next reboot

you can’t get around this issue.
