# How to disable the SCP protocol on an SSH server?

**URL:** <https://hostingthreads.com/t/how-to-disable-the-scp-protocol-on-an-ssh-server/46>\
**Category:** Linux Troubleshooting\
**Tags:** scp\
**Created:** [March 28, 2026, 10:48pm UTC](https://hostingthreads.com/t/how-to-disable-the-scp-protocol-on-an-ssh-server/46 "2026-03-28T22:48:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jennifer](https://hostingthreads.com/user_avatar/hostingthreads.com/jennifer/32/27_2.png) [@jennifer](https://hostingthreads.com/u/jennifer)\
**Post date:** [March 28, 2026, 10:48pm UTC](https://hostingthreads.com/t/how-to-disable-the-scp-protocol-on-an-ssh-server/46/1 "2026-03-28T22:48:28Z")

</div>

Hello everyone, Any idea of how can I turn off the SCP protocol on an SSH server?

Thanks, Jenn

---

<div class="post-metadata">

**Author:** ![sohailqamar](https://hostingthreads.com/user_avatar/hostingthreads.com/sohailqamar/32/31_2.png) [@sohailqamar](https://hostingthreads.com/u/sohailqamar)\
**Post date:** [March 28, 2026, 11:57pm UTC](https://hostingthreads.com/t/how-to-disable-the-scp-protocol-on-an-ssh-server/46/2 "2026-03-28T23:57:09Z")

</div>

Hello,

By default in Alma Linux 9, the scp command operates over the SFTP protocol rather than the traditional SCP protocol. Even so, you can still force it to use the old SCP protocol by using the -O option. In addition, the sshd service continues to permit connections from clients that rely on the SCP protocol.

To completely disable the use of the SCP protocol, create a file named /etc/ssh/disable\_scp by running the following command:

```auto
# touch /etc/ssh/disable_scp

```

When the file is created, the scp command no longer permits using the -O option to enable the SCP protocol.

On Alma Linux 9, the scp command defaults to using the SFTP protocol, but it is still possible to use the SCP protocol unless it is explicitly disabled; in addition, the sshd service continues to accept connections from clients that use the SCP protocol unless configured otherwise.

On Alma Linux 8, the scp command uses the SCP protocol as the default.

You can confirm that the SCP protocol is disabled on Alma Linux 9 by trying to transfer a file using the -O option.

```auto
$ scp -O file localhost:
SCP protocol is forbidden via /etc/ssh/disable_scp

```

On Alma Linux 8, the scp command does not recognize the -O option and always operates using the SCP protocol.

```auto
$ scp file localhost:
SCP protocol is forbidden via /etc/ssh/disable_scp

```

Cheers 👋
