Open the file /etc/ssh/sshd_config
sudo vim /etc/ssh/sshd_config
Find "Subsystem sftp /usr/lib/openssh/sftp-server", comment it out, and add a line, the content is as follows:
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp /bin/false
Then restart the ssh service:
sudo service sshd restart