To turn off the SFTP server but allow SSH login on a Linux or Unix server with cPanel, you can use the following steps:
Log in to the cPanel server: Use an SSH client such as ssh
to log in to the cPanel server as the root user.
Edit the /etc/ssh/sshd_config
file: Open the /etc/ssh/sshd_config
file in a text editor and find the following line:
Subsystem sftp /usr/libexec/openssh/sftp-server
#
character at the beginning of the line to comment it out. The line should now look like this:# Subsystem sftp /usr/libexec/openssh/sftp-server
This will disable the SFTP server but allow SSH login.
/etc/ssh/sshd_config
file and exit the text editor. Then, restart the SSH service by running the following command:systemctl restart ssh
This will apply the changes and restart the SSH service.
Keep in mind that you will need to have root privileges (or be a member of the sudo
group) in order to edit the /etc/ssh/sshd_config
file and restart the SSH service.
After making these changes, the SFTP server will be disabled but SSH login will still be allowed.