Skip to content

glftpd | Gentoo Linux

glFTPd is a very advanced ftp server with lots of possibilities.

One of the main differences between many other ftp servers and glFTPd is that it has its own user database which can be completely maintained online using ftp site commands. Using ftp site commands it is also possible to see stats, view logs, execute scripts and do many more things.


Installation

 emerge --ask zip unzip xinetd
 /etc/init.d/xinetd start
 wget -P /tmp https://glftpd.io/files/glftpd-LNX-2.12_3.0.1_x64.tgz
 tar -xvf /tmp/glftpd-LNX-2.12_3.0.1_x64.tgz -C /tmp/
 cd /tmp/glftpd-LNX-2.12_3.0.1_x64
./installgl.sh
./create_server_key.sh ecdsa ok

lftp -e open ftp://localhost:65005 -u glftpd:glftpd -e \
    "site adduser <user> password *@$(curl ifconfig.co)"
Intall glFTPd
                 ###  #     ##### ##### ####  ####        ###   
                #   # #     #       #   #   # #   #      #   #  
                #     #     ###     #   #   # #   #         #   
                #  ### #     #       #   ####  #   #        #    
                #   # #     #       #   #     #   #       #     
                 ###  ##### #       #   #     ####       #####  


                      --== WE MAKE FILES TRANSFER ==--


         -----------------------------------------------------------
                      GLFTPD INSTALLER v2.0.12 (linux)

              Originally done by jehsom and dn.
              Made ready for the new era by turranius and psxc.  
         -----------------------------------------------------------


    Before we begin: If this installer fails on your system, please
    let the devs know. You find us on irc (efnet) in #glftpd. Thank you.
    Also, any bugs found in glftpd itself should be reported either to
    the board @ http://www.glftpd.eu, in the irc channel, or both.

    Press <enter> to continue. 


    1. TCPD SETUP:
    --------------

    Do you wish to use tcpd? If you are not sure then you should not
    use it. If you decided to change this at a later time, please
    search for tcpd in glftpd.docs for the required changes.

    Use tcpd? [Y]es [N]o: N
    Installing glftpd without tcpd.

    2. JAIL SETUP:
    --------------

    Do you want to run glftpd in a "Jailed" environment?  In this
    environment a private directory will be created and glftpd will
    be installed inside.  Regular shell users will not be able to get
    inside this private directory.  The glftpd.conf is also moved
    inside for added security and a new group will be created so
    you and other users you specify can access glftpd through the shell.

    Use a jailed environment? [Y]es [N]o: N


    3. GLFTPD BASE SETUP:
    ---------------------

    Please enter the directory to install glftpd to [/glftpd]: /mnt/usb
    Path already exists. [D]elete it, [A]bort, [T]ry again, [I]gnore? I
    Copying glftpd files to /mnt/usb . . . Done.

    Copying required binaries to /mnt/usb/bin:
    All binaries successfully copied.

    Making glftpd's /dev/null , /dev/full , /dev/zero & /dev/urandom . . . Done.


    4. SERVICE SETUP & MULTI-INSTALL:
    ---------------------------------

    Enter a service name for glftpd. This name will be used as the
    service name mapped to the port in /etc/services, the name
    used in your (x)inetd settings, and the name of your config-file.
    NOTE: If you (wish to) have multiple instances of glftpd on the
    same box, you *must* to change this.
    Press <enter> for the default (usb)> 

    You did not choose the default servicename for glftpd. If you plan on
    having more than one instance of glftpd, you should change the ipc_key.
    The ipc_key can be anything you want, but it must be unique. To make
    things easy in this installer, you will be provided with 10 choices.
    1: 0x0000BABE   2: 0xDEADBABE   3: 0x00C0FFEE  4: 0x12345678
    5: 0x87654321   6: 0xBEEFBABE   7: 0xBADCOFEE  8: 0x0000BEEF
    9: 0xDEADBEEF   0: 0x0000DEAD (default)
    Choose a number (0-9) > 1


    5. COMPILING SOURCES & COPYING LIBS:
    ------------------------------------

    modifying source (/mnt/usb/bin/sources/glconf.h) ... OK.
    Compiling source files in /mnt/usb/bin/sources to /mnt/usb/bin:
       ansi2gl .. OK.
       dirlogclean .. OK.
       dirloglist .. OK.
       dirlogscanner .. OK.
       dirlogsearch .. OK.
       dupeadd .. OK.
       dupecheck .. OK.
       dupediradd .. OK.
       dupelist .. OK.
       dupescan .. OK.
       flysfv .. OK.
       ftpwho .. OK.
       glupdate .. OK.
       killghost .. OK.
       nukelogclean .. OK.
       nukelogscanner .. OK.
       olddirclean2 .. OK.
       undupe .. OK.
       userstat .. OK.
       weektop .. OK.
    All source files successfully compiled.

    Copying required shared library files:
       ld-linux-x86-64.so.2: OK
       libacl.so.1: OK
       libattr.so.1: OK
       libbz2.so.1: OK
       libcrypt.so.1: OK
       libc.so.6: OK
       libdl.so.2: OK
       libm.so.6: OK
       libreadline.so.8: OK
       libtinfo.so.6: OK
       libtinfow.so.6: OK
       libnatspec.so.0: OK
       libpcre2-8.so.0: OK

    Copying your system's run-time library linker(s):
    (NOTE: Searches can take a couple of minutes, please be patient.)

    Configuring the shared library cache . . . Done.


    6. PORT AND SYSTEM SETUP:
    -------------------------

    Enter the port you would like glftpd to listen on [1337]: 65005
    Setting userfile permissions . . . Done.
    Setting groupfile permissions . . . Done.

    Adding glftpd service to /etc/services (as usb) . . . Done.
    Copying glftpd.conf to /etc/usb.conf . . . Done.

    [x]inetd
    [s]ystemd
    choose superserver: x
    Do you wish to use European weeks? European weeks starts with a Monday.
    This is for glftpd's 'reset' binary (see docs for more info) [Y/N]: Y

    Fixing (potential) localtime problems ...
      Creating /mnt/usb/etc/localtime
      Creating /mnt/usb/usr/lib/zoneinfo
      Creating /mnt/usb/usr/share/zoneinfo
    Done.


    7. SSL/TLS SETUP:
    -----------------

    We will now create a certificate for SSL/TLS support. This step is
    required.


    Please specify location, inside /mnt/usb,
    to install the cert (ftpd-ecdsa.pem) [/etc]: 

    Please specify a generic name for this certificate.
    This can be any name but should say something about the ftp server
    like the name for it perhaps (press enter for usb): 

    Using servbase: usb  Using openssl: /usr/bin/openssl
    Please wait while creating certificate... (will take time!)

    Moving ftpd-ecdsa.pem to /mnt/usb/etc . . . Done

    -> IMPORTANT !!!!
    -> If you get TLS errors of any kind, read instructions in README.TLS
    -> included in this package!

    Press <ENTER> to continue



    8. STARTING GLFTPD:
    -------------------

    Copying /etc/resolv.conf to /mnt/usb/etc/resolv.conf . . . Done.
    Configuring xinetd for glftpd . . . Done.
    Restarting xinetd . . . Success.


    Adding crontab entry to tabulate site stats nightly . . . Done.

    chmod'ing the site/ dir . . . Done.

    Press <ENTER> to continue.



    9. FINISH:
    ----------

    Congratulations, glFtpD has been installed. Scroll up and note any errors
    that needs fixing. ./installgl.debug contains a log of the installation process.

    To get your site running, you must edit /etc/usb.conf according to
    the instructions in /mnt/usb/docs/glftpd.docs.
    For help, visit #glftpd on EFnet AFTER you've read (not skimmed) the docs/faq.

    After configuring glftpd, visit the following websites for additional
    scripts to give your site some style!:
            Turranius - http://www.grandis.nu/glftpd
            Jehsoms - http://runslinux.net/
            dn's and ip's - http://www.chimera-coding.com
            D-ViBE's collection - http://www.glftpd.at

    The official glftpd homepage is located at http://www.glftpd.eu

                                     Thanks for your support!
                                     the glFtpD team

Default Login

Default user:glftpd
Default password: glftpd
Connect to glftpd
ftp localhost 65005
Connected to localhost.
220 MY SITE NAME (glFTPd 2.12 (Dec 25 2021) 64BiT Linux+TLS(OpenSSL 3.0.1 14 Dec 2021)+SSP) ready.
Name (localhost:wuseman): glftpd
331 Password required for glftpd.
Password: 
230-                                _____
230- ______________________________|__   |____ ________________________________
230- \     _      /   _     /  _     /   |    |    _     /  _     /    _      /
230-  \    \     /    /    /   /____/.   |    |    /    /   /____/.    /_____/
230-   \________/____/    /______    |___|____|___/    /______    |____|
230- .-=----------- /____/ ---- |____| --------- /____/ ---- |____| -------=-. 
230- `-=-------------------------------------------------------------------=-'
230-       `-----( Type 'site onel MESSAGE' to enter your message )-----'
230 User glftpd logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 
Add and configure all your needs for your own user
ftp> site adduser wuseman <password> *@xxx.xx.xx.xx *@xxx.xx.xx.xx *@xxx.xx.xx.xx *@xxx.xx.xx.xx
200- User created, now adding IPs...
200- IP '*@xxx.xx.xx.xx' successfully added to wuseman.
200- IP '*@xxx.xx.xx.xx' not added: an equal or broader mask already exists.
200- IP '*@xxx.xx.xx.xx' successfully added to wuseman.
200- IP '*@xxx.xx.xx.xx' successfully added to wuseman.
200- 
200 User (wuseman) successfully added.
ftp> site change wuseman ratio 0
200 Command Successful.
ftp> site change wuseman flags +1ABCDFEFHJIKLMOPQRST
200 Command Successful.
ftp> site change wuseman num_logins 100
200 Command Successful.
ftp> site change wuseman max_sim_down 100
200- Changed max simultaneous downloads for wuseman to 100.
200 Command Successful.
ftp> site change wuseman max_sim_up 100
200- Changed max simultaneous uploads for wuseman to 100.
200 Command Successful.
ftp> site grpadd iND
200 Group (iND) successfully added.
ftp> site chgrp wuseman iND
200- 'wuseman' has been successfully added to 'iND'
200 Command Successful.
ftp> site user wuseman
200- User Comment: Added by glftpd
200- +=======================================================================+
200- | Username: wuseman                  Created: 11-20-22                  |
200- | Added by: glftpd                   Expires: Never                     |
200- | Time On Today: 00:00               Last seen: Wed Nov 30 06:37:10 2022|
200- | Flags: 13ABCDEFGHIJKLMOPQRST       Idle time: Disabled                |
200- | Ratios: Unlimited                                                     |
200- | Credits: 14.6MiB                                                      |
200- | Total Logins: 2                    Current Logins: 1                  |
200- | Max Logins: 100                    From same IP: Unlimited            |
200- | Max Sim Uploads: 100               Max Sim Downloads: 100             |
200- | Max Upload Speed:     0.0KiB/s     Max Download Speed:     0.0KiB/s   |
200- | Times Nuked: 0                     Bytes Nuked:      0MiB             |
200- | Weekly Allotment:     0MiB         Messages Waiting: N                |
200- | Time Limit:    0 minutes.          (0 = Unlimited)                    |
200- | Timeframe: 00:00-00:00             (24 hour format)                   |
200- | Tagline: No Tagline Set                                               |
200- | Groups: iND                                                           |
200- | Priv Groups: STAFF                                                    |
200- +-----------------------------------------------------------------------+
200- | IP0: *@xxx.xx.xx.xx                IP1: *@xxx.xx.xx.xx                |
200- | IP2: *@xxx.xx.xx.xx                IP3: *@xxx.xx.xx.xx                |
200- | IP4:                               IP5:                               |
200- | IP6:                               IP7:                               |
200- | IP8:                               IP9:                               |

ftp> quit
221- Goodbye
221 

RE-Login with your new user

ftp localhost 65005

Installation complete...

Configure glftpd.conf
cat << EOF >> /etc/glftpd.conf
calc_crc        *
post_check      /bin/zipscript-c *

cscript         DELE                    post    /bin/postdel
cscript         RMD                     post    /bin/datacleaner
cscript         RETR                    post    /bin/dl_speedtest
cscript         SITE[:space:]NUKE       post    /bin/cleanup
cscript         SITE[:space:]WIPE       post    /bin/cleanup
cscript         SITE[:space:]UNNUKE     post    /bin/postunnuke


site_cmd         INVITE         EXEC   /bin/invite.sh
site_cmd         SEARCH         EXEC   /bin/tur-mysqlsearch.sh 
site_cmd         RESCAN         EXEC   /bin/rescan
site_cmd         AUDIOSORT      EXEC   /bin/audiosort

custom-invite           *      *
custom-search           *      *
custom-rescan           *      *
custom-audiosort        *      *

# To allow FXP (see docs for various settings): 
allow_fxp   yes   yes   yes   *

# Stop bot from announcing each FXP transfer out: 
allow_fxp   yes   yes   no   *   

# Pasv addr and ports
pasv_ports 10000-11000 
pasv_addr $(curl ifconfig.co) 1
EOF

Script/Plugins

Total Rescan

curl -o /glftpd/bin/total-rescan.pl https://raw.githubusercontent.com/pzs-ng/scripts/master/total-rescan/total-rescan.pl
chmod +x /glftpd/bin/total-rescan.pl