Skip to main content
3 of 4
Modified information relating to newer versions of scp
Chris Davies
  • 128.3k
  • 16
  • 179
  • 324

SFTP is built-in to the SSH protocol and therefore the SSH server.

You can disable the functionality on the server if it's not required by changing /etc/ssh/sshd_config so that you remove the Subsystem line corresponding to the sftp-server.

For example, this line defines an external sftp-server utility to handle the SFTP service:

Subsystem sftp-server 

This line defines an internal implementation of the SFTP service:

Subsystem internal-sftp 

Removing or commenting out the Subsystem line will disable the SFTP service entirely.

# Subsystem … 

Remember that tools such as rsync (if it's installed) and versions of scp will still function, though, so disabling SFTP will not of itself prevent users from transferring files between client and server. (Older versions of scp will work independently of SFTP. Newer versions use SFTP but can be forced to use the older protocol with the -O flag.) There are also "trivial" solutions such as ssh remoteHost cat somefile > local_copy_of_somefile to consider.

Chris Davies
  • 128.3k
  • 16
  • 179
  • 324