3.4. ftp

3.4.1. NAME

ftp - Guardian Digital WebTool module interface to the vsftpd FTP server.

3.4.2. SYNOPSIS

use ftp;
my $ftp  = new ftp($page);

3.4.3. DESCRIPTION

This Guardian Digital WebTool module provides an interface to manipulating the system FTP server. This module allows you to manage the vsftpd configuration file, chroot list, and blacklist.

3.4.4. METHODS

read_vsftpd_xinetd_conf()

This function reads /etc/xinetd.d/ftp configuration file line by line and returns interface it should listen to, in form of hash reference.

Example Usage:

my $xinetd = $ftp->read_vsftpd_xinetd_conf();
my $interface  = $xinetd->{'iface'};

write_vsftpd_xinetd_conf($)

This function basically writes interface that it should listen to, into /etc/xinetd.d/ftp configuration file. It receives interface value as argument(hash reference), if interface is not defined than it sets 127.0.0.1(localhost) as default interface.

Example Usage:

$conf = { 'iface' => $interface };
$ftp->write_vsftpd_xinetd_conf($conf);

restart()

This function restarts the xinetd service.

Example Usage:

$ftp->restart();

read_vsftpd_conf()

This function basically reads /etc/vsftpd.conf file line by line and makes hash of key-value pairs. It also reads contents of ftp's blacklist and chroot from their respective configuration files and updates the hash. Ultimately it returns hash reference containing all values as a result.

Example Usage:

my $conf  = $ftp->read_vsftpd_conf();

write_vsftpd_conf($)

This function basically writes to /etc/vsftpd.conf file. It receives hash reference containing key-value pair(parameters as keys and their respective values) for vsftpd.conf file. It also writes interface value in ftp configuration file under xinetd.d directory.

Example Usage:

$ftp->write_vsftpd_conf($conf);

write_vsftpd_black_list($)

This function writes out users provided as argument(array reference), to /etc/ftpusers file(blacklist).

Example Usage:

@black_list = ('mysql','nobody');
$ftp->write_vsftpd_black_list(\@black_list);

write_vsftpd_chroot_list($)

This function writes out users provided as argument(array reference), to /etc/vsftpd.chroot_list file(chroot).

Example Usage:

@chroot_list = ('mysql','nobody');
$ftp->write_vsftpd_chroot_list(\@chroot_list);

3.4.5. AUTHORS

Ryan W. Maple <ryan@guardiandigital.com>

3.4.6. COPYRIGHT AND LICENSE

Copyright Guardian Digital, Inc., All Rights Reserved