Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Sunday 22 January 2017

How to Configure Proftpd on RHEL/CentOS 6x

How to Configure Proftpd on RHEL/CentOS 6x


Q. What is Proftpd?

-- ProFTPD is an FTP Server. ProFTPD is Free & open-source software, compatible with Unix-like systems and Microsoft Windows (via Cygwin). Along with vsftpd, Pure-FTPd and ProFTPD is among the most popular FTP servers in Unix-like environments today.

Step: 1. Install the EPEL Repository :

# yum -y install epel-release

Step: 2. Install Proftpd :

# yum -y install proftpd

Step: 3. Restart Proftp Service :

# service proftpd restart
# chkconfig proftpd on

Step: 4. Configure Proftpd :

# vi /etc/proftpd.conf

ServerName     "Give Hostname"

MasqueradeAddress       192.168.100.10    # Server IP Address
PassivePorts 60000 65535

# For Extension Retriction :

PathAllowFilter "\\.(jpg|jpgeg|mpeg|mpg|mp3)$"

or

PathDenyFilter "\\.(pdf|ini)$"

# For Upload File Size Limit :

MaxStoreFileSize  25 Mb
MaxRetrieveFileSize  25 Mb

# Jailing Directory :
<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                ftp
Group                                            ftp
RequireValidShell                   off
<Directory *>
<Limit WRITE>
    AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

# service proftpd restart

Note: If proftpd service fails to start bind it in hosts file.

# vi /etc/hosts

Add the <machine ip> <machine name>

Step: 5. Add a System User To Access FTP Server :

# useradd -d /home/koushik koushik
# passwd koushik

-- Give Password.

Go To Proftp Configuration File :

# vi /etc/proftpd.conf

-- At the End Add those Lines :

<Anonymous /var/ftp/pub>
AnonRequirePassword       on
User                                                <username>
Group                                              ftp
RequireValidShell                     off
<Directory *>
<Limit WRITE>
          AllowAll
</Limit>
</Directory>
</Anonymous>

-- Save & Quit (:wq)

Step: 6. Change Server Level :

# vi /etc/pam.d/proftpd

-- Delete all & Add those Lines :

#%PAM-1.0
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth include system-auth
auth required pam_shells.so
account include system-auth
session include system-auth
session required pam_loginuid.so

-- Save & Quit (:wq)

Step: 7. Restart Proftpd Service :

# service proftpd restart
# chkconfig proftpd on

Step: 8. Proftp Configuration for Specific User & Directory :

# groupadd ftpusers

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/nologin username
# passwd username

-- Give Password.

Step: 9. Change Group :

# chown -Rf username:ftp domain.com (Directory name of the Site)

Example :

# useradd -d /var/www/html/domain.com -G ftp -g ftpusers -s /sbin/lologin ftpdomain
# passwd ftpdomain

-- Give Password.

# chown -Rf ftpdomain:ftp /var/www/html/domain.com

Step: 11. Testing Proftpd Server :

-- Install Filezilla & Test the FTP Server.

Thanks For Visiting on My Blog, For More Tutorials Keep Visiting My Blog

0 comments:

Post a Comment

Copyright © 2016 Kousik Chatterjee's Blog