How to: Turning off SFTP server under Linux / UNIX cpanel server

by on October 10, 2007 · 5 comments· LAST UPDATED October 10, 2007

in , ,

Q. I've CentOS Linux cpanel server. I'd like to turn off SFTP server but only allow SSH for root user. How do I trun off sftp server?

A. OpenSSH / sshd reads configuration data from /etc/ssh/sshd_config. The file contains keyword-argument pairs, one per line. Lines starting with ‘#’ and empty lines are interpreted as comments. Configures an external subsystem such file transfer daemon (SFTP) done through this file only. Arguments should be a subsystem name and a command to execute upon subsystem request. The command sftp-server implements the “sftp” file transfer subsystem. sftp-server is a program that speaks the server side of SFTP protocol. sftp-server is not intended to be called
directly, but from sshd using the Subsystem option.

Disable / Turn off sftp server

Open /etc/ssh/sshd_config file:
# vi /etc/ssh/sshd_config
Find line that read as follows:
Subsystem sftp /usr/lib/openssh/sftp-server
Remove or comment out line by prefixing #:
# Subsystem sftp /usr/lib/openssh/sftp-server
Save and close the file. Restart sshd service:
# /etc/init.d/sshd restart

Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 5 comments… read them below or add one }

1 Kilian June 23, 2011 at 6:35 pm

so its gonn abe normal FTP then? cause SFTP was so slow I couldnt work on it


2 Marc December 5, 2011 at 2:52 pm

No it doesn’t. Not much support on how to enable normal (non secure) FTP ;p


3 Nenad Marjanovic January 8, 2013 at 8:15 pm

Better solution is to replace :

Subsystem sftp /usr/lib/openssh/sftp-server

Replace with :

Subsystem sftp /bin/false


4 Jon June 2, 2014 at 5:39 pm

Why is that a better solution?


5 ovi June 12, 2014 at 1:27 pm

because that one works…


Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: