How to turn off SFTP server but allow SSH login under Linux and Unix CPanel server

How to turn off SFTP server but allow SSH login under Linux and Unix CPanel server

To turn off the SFTP server but allow SSH login on a Linux or Unix server with cPanel, you can use the following steps:

  1. Log in to the cPanel server: Use an SSH client such as ssh to log in to the cPanel server as the root user.

  2. Edit the /etc/ssh/sshd_config file: Open the /etc/ssh/sshd_config file in a text editor and find the following line:

refer t‮uttual:o‬ri.com
Subsystem sftp /usr/libexec/openssh/sftp-server
  1. Comment out the line: Add a # 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.

  1. Save the file and restart the SSH service: Save the changes to the /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.

Created Time:2017-10-29 22:08:39  Author:lautturi