calum0812

Registered
Aug 16, 2011
3
0
51
Hi,
I am a member of staff at X5 Hosting, we provide free web hosting. However, our services have grounded to a hualt after finding out some disturbing news that clients are able to go up 2 diretories from the web hosting area on FTP and go into the main directory (/). The only way clients can do this is by connecting via SFTP (secure FTP) and I could do with finding out how to diable it, or take a different form of action to prevent my server from being hacked.

Fast reponces appriciated,
Calum
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello :)

SFTP uses a shell environment and access is only granted to the cPanel account username. Access to SFTP is not granted to virtual FTP accounts that are created via the "FTP Accounts" option within cPanel.

With SFTP, users can only browse to higher level directories. However, they are not able to modify or view the contents of any files they do not have access to.

In order to disable SFTP for the entire system, you can edit the following file:

Code:
/etc/ssh/sshd_config
Within this file, comment out the following line:

Code:
Subsystem sftp /usr/libexec/openssh/sftp-server
Once you save the file, you can restart SSH to ensure the change takes effect.

Code:
# service sshd restart
Thank you.
 

calum0812

Registered
Aug 16, 2011
3
0
51
Sorry, I am still a little confused :s
I open the sshd_config file, and then what?
I know you said comment out the following line, but I don't know what that means :) and I don't want to muck anything up.

Kind regards,
Calum
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
You would open up the file in the text editor of your choice (e.g. vi or pico) and then adjust the following line:

Code:
Subsystem sftp /usr/libexec/openssh/sftp-server
To:

Code:
# Subsystem sftp /usr/libexec/openssh/sftp-server
Notice the addition of the hash symbol; which is what comments out (disables) the line.

Thank you.
 

calum0812

Registered
Aug 16, 2011
3
0
51
Fantastic!
Brilliant!

WORKED!

Thanks a trillion for all of your help on this matter. It just goes to show, with a brialliantly organised Forum and friendly staff, people like me can get there issues reolved extreemly fast.

Thanks Michael!