Jump to content
Facebook Twitter Youtube

[Linux-Tutorial] How to setup FTP Server


Filex Dragneel
 Share

Recommended Posts

In this tutorial i'll show you how to setup/create/make your own FTP server.

1st let's start with , what's FTP and what is it about..

 

FTP or File Transfer Protocol is a standard network protocol used for the transfer of computer files between a client and server on a computer network.

FTP is built on a client-server model architecture using separate control and data connections between the client and the server. FTP users may authenticate themselves with a clear-text sign-in protocol, normally in the form of a username and password, but can connect anonymously if the server is configured to allow it. For secure transmission that protects the username and password, and encrypts the content, FTP is often secured with SSL/TLS (FTPS) or replaced with SSH File Transfer Protocol (SFTP).

 

  1. Open Terminal by pressing CTRL+ALT+T
    The Terminal looks like this :
    image.png.d3c2ec87aaec606046ddc0e2cb01fea1.png

     
  2. Make sure your system is up to date.
    Type in the terminal the following commands:
    sudo apt-get update
    sudo apt-get upgrade

    image.png

     

  3. Install Pure-FTPd
    Pure-FTPd is a free (BSD license) FTP Server with a strong focus on software security.
    Run the following command to install it:
     

    sudo apt-get install pure-ftpd

    image.png

     

  4. Configure Pure-FTPd

    Aftter you have installed the FTP server , you'll find all of Pure-FTPd's configuration files in the directoy below. The diffrence between Pure-FTPd and the other FTP servers , is that there's not a single configuration file to configure Pure-FTPd. Diffrent settings have their own file.

    So, in the below location is where you’ll find the files for individual stetting.
     

    /etc/pure-ftpd/conf

    To configure Pure-FTPd and allow basic security, run the these commands. These commands set individual settings for the server.
     

    sudo bash
    echo "yes" > /etc/pure-ftpd/conf/Daemonize
    echo "yes" > /etc/pure-ftpd/conf/NoAnonymous
    echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone
    echo "yes" > /etc/pure-ftpd/conf/IPV4Only
    echo "yes" > /etc/pure-ftpd/conf/ProhibitDotFilesWrite
    exit

    image.png

     

    Quote

    Daemonize = Runs Pure-FTPd as daemon
    NoAnonymous = disable Anonymous logins
    ChrootEveryone = Keep everyone in their home directory
    IPV4Only = Only allow IPv4 to connect
    ProhibitDotFilesWrite = Don’t not edit dot files


    Now , you need to restart the server , so these changes takes an effect , run the following command:

    sudo systemctl restart pure-ftpd


    image.png

    Here are some other settings that you can add:
     

    Spoiler

    echo     "yes"    >          BrokenClientsCompatibility
    echo     "50"        >            MaxClientsNumber
    echo     "5"            >               MaxClientsPerIP
    echo    "no"        >            VerboseLog
    echo    "yes"        >            DisplayDotFiles
    echo    "yes"       >         NoChmod
    echo    "no"        >         AnonymousOnly
    echo    "no"        >              PAMAuthentication
    echo    "no"       >               UnixAuthentication
    echo    "/etc/pure-ftpd/pureftpd.pdb" > PureDB
    echo    "yes"        >       DontResolve
    echo    "15"          >      MaxIdleTime
    echo    "2000 8"   >      LimitRecursion
    echo    "yes"          >     AntiWarez
    echo    "no"           >     AnonymousCanCreateDirs
    echo    "4"           >     MaxLoad
    echo    "no"         >     AllowUserFXP
    echo    "no"        >     AllowAnonymousFXP
    echo    "no"          >     AutoRename
    echo    "yes"        >     AnonymousCantUpload
    echo    "yes"         >     NoChmod
    echo    "80"         >     MaxDiskUsage
    echo    "yes"         >     CustomerProof
    echo    "0"           >        TLS


     

  5. Create FTP users


    Now let's create some users & passwords for your FTP server.
    I'll name my ftp user "fixik_admin" and I will give this user access to my Counter-Strike 1.6 Server files

    pure-pw useradd fixik_admin -u ftpuser -d /home/Desktop/My\ Files/Counter-Strike\ 1.6/Servers/hlds/27015 -m

    Now.. while executing this long command , i got an error saying  passwd file: no such file or directory...

    image.png

    To fix this , run the following commands :

     

    sudo touch /etc/pure-ftpd/pureftpd.passwd
    sudo pure-pw mkdb -F /etc/pure-ftpd/pureftpd.pdb

    After that , try to run the command for creating user again...

    IMPORTANT: due to some errors , use the following command below instead of the one that is up:
     

    sudo pure-pw useradd fixik_admin -u 2 -g 2 -d /home/Desktop/My\ Files/Counter-Strike\ 1.6/Servers/hlds/27015 -m


    IMPORTANT: Everytime when you create a new user changed the numbers of "-u 2 -g 2" to something else.

    Syntax: sudo pure-pw useradd USERNAME -u ID -g ID -d FTP_Directory_FULL_PATH -m


    After you type this , you'll be asked what password you want to give to the user. Screenshot:

    image.png

    Now finnaly to finish this.. , run the following command:
     

    sudo pure-pw mkdb


     

  6. Test your FTP Server

    Simply , open your FTP client like , WinSCP , FileZilla or any other ftp client..
     i'll use my Browser and use the link ftp://MY_IP_Address

    image.png

    image.png

 

  • I love it 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

WHO WE ARE?

CsBlackDevil Community [www.csblackdevil.com], a virtual world from May 1, 2012, which continues to grow in the gaming world. CSBD has over 70k members in continuous expansion, coming from different parts of the world.

 

 

Important Links