Disabling FTP access for a particular cPanel account
admin | Jun 22, 2009 | Comments 0
Issue:
FTP access for specific cPanel accounts needs to be disabled. There is no native way in cPanel/WHM to achieve this.
Solution :
Assuming that you are using pure-ftpd, go to /usr/sbin/pureauth . There would be a section in the code as follows :
# Create ftpusers array
if ( -e ‘/etc/ftpusers’ && !-z ‘/etc/ftpusers’ ) {
open my $ftpusers_fh, ‘<', '/etc/ftpusers';
my @ftpusers = <$ftpusers_fh>;
close $ftpusers_fh;
@ftpusers = grep { s/[\r\n\s]//g } @ftpusers;# disallow accounts in ftpusers
if ( any( sub { lc($acctowner) eq lc($_) }, @ftpusers ) ) {
failed_auth();
}
}
All you need to do is create a file as /etc/ftpusers and put the cPanel usernames in it.
FTP access will no longer be available to the cPanel accounts corresponding to these usernames.
Others would be able to login!
Filed Under: Quick fixes • Technical
About the Author: InstaCarma is a provider of Enterprise Class Solutions for the Hosting Industry

1800 810 6547