Disabling FTP access for a particular cPanel account

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 fixesTechnical

Tags:

About the Author: InstaCarma is a provider of Enterprise Class Solutions for the Hosting Industry

RSSComments (0)

Trackback URL

Leave a Reply

Get Adobe Flash playerPlugin by wpburn.com wordpress themes
InstaCarma provides outsourced web hosting technical support, helpdesk management, datacenter automation, cloud service management. Sales - 1800 810 6547 - visit www.instacarma.com