MEWBIES@:  Facebook  Twitter  G+  YouTube  DeviantArt  Forum  Wall
 SHARE:
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌                 -   GLFTPD - CONDENSED VERSION  -                       █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ FULL version of this tutorial is HERE.                                     ▐▌
 █                                                                            ▐▌
 █ NOTE: Though this tutorial was done using v2.01 (2005-12-25) it is still   ▐▌
 █ applicable and updated for the latest v2.04; just change any commands that ▐▌
 █ state '2.01' to 2.04 or the latest version. Always use the latest stable.  ▐▌
 █                                                                            ▐▌
 █ PREREQUISITES:                                                             ▐▌
 █ INSTALLING GLFTPD:                                                         ▐▌
 █ INETD ERROR?:                                                              ▐▌
 █ STARTING GLFTPD SERVER:                                                    ▐▌
 █ SETTING GLFTPD PERMS:                                                      ▐▌
 █ LOGIN TO YOUR FTP FIRST VIA SSH:                                           ▐▌
 █ THEN LOGIN TO YOUR FTP VIA AN FTP CLIENT:                                  ▐▌
 █ CRONTAB:                                                                   ▐▌
 █ CREATING YOUR SECTIONS FOR SERVER:                                         ▐▌
 █ PREPARING FOR GLFTPD CONFIGURATIONS:                                       ▐▌
 █ SECURITY STEP:                                                             ▐▌
 █ CONFIGURING GLFTPD:                                                        ▐▌
 █ USERS VIEW THEIR HOME DIRECTORY ONLY:                                      ▐▌
 █ CUSTOMIZING YOUR MESSAGES:                                                 ▐▌
 █ INSTALLING EXTRA SCRIPTS:                                                  ▐▌
 █ UNDUPE FILES VIA SSH:                                                      ▐▌
 █ DATED DIRECTORIES AUTOMATICALLY MADE:                                      ▐▌
 █ GLFTPD LOGS:                                                               ▐▌
 █                                                                            ▐▌
 █ PREREQUISITES:                                                             ▐▌
 █ ``````````````                                                             ▐▌
 █ Update your server:                                                        ▐▌
 █ su                                                                         ▐▌
 █ apt-get update && apt-get upgrade                                          ▐▌
 █                                                                            ▐▌
 █ To view what is already installed:                                         ▐▌
 █ dpkg -l                                                                    ▐▌
 █ Skip the ones that you have already and install the others:                ▐▌
 █ su                                                                         ▐▌
 █ apt-get install libncurses5-dev zip unzip openssl tcpd openbsd-inetd       ▐▌
 █ you might also need:                                                       ▐▌
 █ apt-get install inetutils-inetd tcp_wrappers                               ▐▌
 █ And if you are going to use a site bot (eggdrop):                          ▐▌
 █ apt-get install tcl8.5 tcl8.5-dev                                          ▐▌
 █ And if you are going to use pzs-ng zip script:                             ▐▌
 █ apt-get install cURL libssl-dev                                            ▐▌
 █                                                                            ▐▌
 █ You'll need to know if your server is using inetd or xinetd as you'll be   ▐▌
 █ prompted during install to select one. To view which one you are running:  ▐▌
 █ ps aux | egrep '[xi]netd'                                                  ▐▌
 █ Or if you have netstat:                                                    ▐▌
 █ netstat -tulpn | grep LISTEN | egrep '[xi]netd'                            ▐▌
 █ Output will state which you are running, for example:                      ▐▌
 █ 0.0  0.1   2380   656 ?        Ss   Mar04   0:00 /usr/sbin/inetd           ▐▌
 █ 0 0.0.0.0:143             0.0.0.0:*               LISTEN      2444/inetd   ▐▌
 █                                                                            ▐▌
 █ exit                                                                       ▐▌
 █                                                                            ▐▌
 █ INSTALLING GLFTPD:                                                         ▐▌
 █ ``````````````````                                                         ▐▌
 █ Check glFTPd site first for the latest version and for the OS and bit      ▐▌
 █ version you need. For my setup (Debian x86) this is what I did using v2.01:▐▌
 █ wget http://glftpd.dk/files/glftpd-LNX_2.01.tgz                            ▐▌
 █ (Latest version now for Debian x86 is:                                     ▐▌
 █ http://www.glftpd.eu/files/glftpd-LNX-2.04_1.0.1e-2+deb7u3_x86.tgz)        ▐▌
 █ tar -zxvf glftpd-LNX_2.01.tgz                                              ▐▌
 █ rename glftpd--LNX_2.01 to glftpd for ease:                                ▐▌
 █ mv glftpd--LNX_2.01 glftpd                                                 ▐▌
 █ cd glftpd                                                                  ▐▌
 █ su                                                                         ▐▌
 █ ./installgl.sh                                                             ▐▌
 █ Press <enter> to continue.                                                 ▐▌
 █ Use tcpd? [Y]es [N]o: Y                                                    ▐▌
 █ Use a jailed environment? [Y]es [N]o: Y                                    ▐▌
 █ Use a private group? [Y]es [No]: Y                                         ▐▌
 █ What would you like your private group to be called? : mewbie              ▐▌
 █ Who should have access to glftpd? (separate with ,): doggie                ▐▌
 █ Please enter the directory inside /jail to install glftpd to [/glftpd]:    ▐▌
 █ /glftpd                                                                    ▐▌
 █ Press <enter> for the default (glftpd)> glftpd                             ▐▌
 █ *My note: If you see this error: glupdate .. FAILED!                       ▐▌
 █ Don't worry, unless you are doing an update.                               ▐▌
 █ Enter the port you would like glftpd to listen on [1337]: 33669            ▐▌
 █ 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        ▐▌
 █ Please specify location, inside /jail/glftpd, to install the cert          ▐▌
 █ (ftpd-dsa.pem) [/etc]: /jail                                               ▐▌
 █ Note: from v2.02 it will generate a ECDSA cert; ftpd-ecdsa.pem             ▐▌
 █ 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 glftpd): glftpdmewbie                                     ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ INETD ERROR?:                                                              ▐▌
 █ `````````````                                                              ▐▌
 █ If you see an error similar to this OR can't login to your FTP (login -    ▐▌
 █ next section in tut):                                                      ▐▌
 █ Restarting inetd . . . Failed! You must restart inetd before using glftpd. ▐▌
 █ Do this to see if inetd is listed as running:                              ▐▌
 █ ps -A                                                                      ▐▌
 █ find reply in list something like this: 1899 ? 00:00:00 inetd              ▐▌
 █ If it is running stop it:                                                  ▐▌
 █ killall -HUP inetd                                                         ▐▌
 █ or                                                                         ▐▌
 █ kill -HUP [PID of inetd] which in my reply above PID would be:             ▐▌
 █ kill -HUP 1899                                                             ▐▌
 █                                                                            ▐▌
 █ Then we need to edit the inetd.conf:                                       ▐▌
 █ (to read about inetd: man inetd.conf )                                     ▐▌
 █ pico /etc/inetd.conf                                                       ▐▌
 █                                                                            ▐▌
 █ If these lines aren't in the file add them at the bottom (mine weren't):   ▐▌
 █ #:OTHER: Other services                                                    ▐▌
 █ glftpd stream tcp nowait root /usr/sbin/tcpd /glftpd/bin/glftpd -l -o -i   ▐▌
 █                                                                            ▐▌
 █ Now start inetd:                                                           ▐▌
 █ /etc/init.d/openbsd-inetd start                                            ▐▌
 █                                                                            ▐▌
 █ *My note: After updating Debian version those lines in my inetd.conf now   ▐▌
 █ are like this:                                                             ▐▌
#:OTHER: Other services
#<off># netbios-ssn stream tcp nowait root /usr/sbin/tcpd /usr/sbin/smbd

glftpd stream tcp nowait root /usr/sbin/tcpd /jail/glftpd/bin/glftpd -l -o -i -r /jail/glftpd.conf -s/jail/glftpd/bin/bin/glstrings.bin -e

█ ▐▌ █ Done with the install. Now to start the server and set some perms etc. ▐▌ █ ▐▌ █ STARTING GLFTPD SERVER: ▐▌ █ ``````````````````````` ▐▌ █ To start the server: ▐▌ █ /etc/init.d/openbsd-inetd start ▐▌ █ (to stop it: /etc/init.d/openbsd-inetd stop ) ▐▌ █ ▐▌ █ To have glFTPd run after rebooting the machine you'll need to either: ▐▌ █ Manually add it to the sysv-rc-conf list; shows what will be started on ▐▌ █ reboot: ▐▌ █ sysv-rc-conf ▐▌ █ To navigate use arrow key, use space key to toggle an item on [X] or off ▐▌ █ [ ] ▐▌ █ For glFTPd toggle on 2-5 for openbsd-inetd ▐▌ █ q to quit that window ▐▌ █ ▐▌ █ Or you can simply issue that with a cmd: ▐▌ █ sysv-rc-conf openbsd-inetd on ▐▌ █ Which will toggle on 2-5. ▐▌ █ To remove it from start up list: sysv-rc-conf openbsd-inetd off ▐▌ █ To view the list: sysv-rc-conf --list ▐▌ █ ▐▌ █ SETTING GLFTPD PERMS: ▐▌ █ ````````````````````` ▐▌ █ Make sure all permissions are set correctly in 'jail/glftpd/bin': ▐▌ █ chmod -R 755 /jail/glftpd/bin ▐▌ █ chmod -R 755 /jail/glftpd/lib ▐▌ █ ▐▌ █ Incoming directory is world-wide-read/writeable and 'jail' is indeed ▐▌ █ jailed: ▐▌ █ chmod 777 /jail/glftpd/site/incoming ▐▌ █ chmod 770 /jail ▐▌ █ ▐▌ █ To set site back to correct perms if you need: ▐▌ █ find /jail/glftpd/site -type d -exec chmod 777 {} \; ▐▌ █ ▐▌ █ Note: All directories you want users to access through glftpd should be ▐▌ █ 755, and incoming directories (users upload to) should be 777. So if for ▐▌ █ example you want users to be able to make directories in the directory ▐▌ █ 'site': ▐▌ █ chmod -R 777 /jail/glftpd/site ▐▌ █ (the '-R' means recursive; all directories in 'site' directory will be ▐▌ █ 777) ▐▌ █ ▐▌ █ exit ▐▌ █ ▐▌ █ LOGIN TO YOUR FTP FIRST VIA SSH: ▐▌ █ ```````````````````````````````` ▐▌ █ ftp 127.0.0.1 33669 ▐▌ █ (replace port 33669 with the port you selected during install above) ▐▌ █ when prompted for a name: glftpd ▐▌ █ when prompted for a pass: glftpd ▐▌ █ ▐▌ █ Now add yourself in this format, using *@* for 'yourself only': ▐▌ █ site adduser NAME PASS IDENT@IP.MASK ▐▌ █ for example: ▐▌ █ site adduser mewbie MyPaSsc45x6 *@* boo@12.234.*.* ▐▌ █ set your flags etc: ▐▌ █ site change mewbie flags +147ABCDEFGHI ▐▌ █ site change mewbie ratio 0 ▐▌ █ site change mewbie num_logins 3 ▐▌ █ site change mewbie max_sim_down 2 ▐▌ █ site grpadd MEW ▐▌ █ site grpchange MEW slots 9 ▐▌ █ site chgrp mewbie MEW ▐▌ █ ▐▌ █ To log off the FTP and return to your shell window: ▐▌ █ bye ▐▌ █ ▐▌ █ THEN LOGIN TO YOUR FTP VIA AN FTP CLIENT: ▐▌ █ ````````````````````````````````````````` ▐▌ █ Now setup your server information in your FTP client tool, like FTPRush, ▐▌ █ and login with the new user you added for yourself (not glftpd user). ▐▌ █ You'll need to set the protocol in your FTP tool to 'SSL FTP (AUTH SSL)'. ▐▌ █ Once you are done playing with your new server let's get to the fun parts: ▐▌ █ ▐▌ █ IF YOU COULDLN'T LOGIN: ▐▌ █ As per the docs: Add "glftpd: ALL" to /etc/hosts.allow (unless you didn't ▐▌ █ use tcpd in inetd.conf) ▐▌ █ ▐▌ █ So do this to see if that line is there: ▐▌ █ cat /etc/hosts.allow ▐▌ █ If it's not, add it: ▐▌ █ pico /etc/hosts.allow ▐▌ █ Mine has this at the bottom: ▐▌ █ GLFTPD: ALL ▐▌ █ ▐▌ █ Still can't login; see above under the section 'INETD ERROR?' for inetd if ▐▌ █ you haven't done that. ▐▌ █ ▐▌ █ CRONTAB: ▐▌ █ ```````` ▐▌ █ This is to set it to do its thing automatically at a set time. To check ▐▌ █ if glftpd is already there: ▐▌ █ crontab -l ▐▌ █ Reply will be similar to: ▐▌ █ contrab: 0 0 * * * /jail/glftpd/bin/reset ▐▌ █ ▐▌ █ If not paste that line in here: ▐▌ █ crontab -e ▐▌ █ ▐▌ █ CREATING YOUR SECTIONS FOR SERVER: ▐▌ █ ``````````````````````````````````` ▐▌ █ MAKE DIRECTORIES FOR EACH SECTION: ▐▌ █ Read the docs to configure it for your own needs. I'm going to list what I ▐▌ █ did for my needs. ▐▌ █ Make directories for each section with their perms (name them as you like, ▐▌ █ MEW directory will be private (only users in group MEW will have access ▐▌ █ and able to this directory- later in the tut): ▐▌ █ su ▐▌ █ chmod -R 777 /jail/glftpd/site/ZIPS ▐▌ █ chmod -R 777 /jail/glftpd/site/SFV ▐▌ █ chmod -R 777 /jail/glftpd/site/M3U ▐▌ █ chmod -R 777 /jail/glftpd/site/MEW ▐▌ █ ▐▌ █ PREPARING FOR GLFTPD CONFIGURATIONS: ▐▌ █ ```````````````````````````````````` ▐▌ █ cp /jail/glftpd.conf /jail/glftpd.conf.backup ▐▌ █ (or your file may be here: /jail/glftpd/glftpd.conf ) ▐▌ █ ▐▌ █ Then copy glftpd.conf (the copy will become the main file that we will ▐▌ █ edit): ▐▌ █ cp /jail/glftpd.conf /jail/glftpd/etc/glftpd.conf ▐▌ █ Then remove (if you had it in this location) as we are going to make a ▐▌ █ symlink to it: ▐▌ █ rm /jail/glftpd.conf ▐▌ █ ▐▌ █ LINK THE FILE TO ETC AND JAIL: ▐▌ █ ln -s /jail/glftpd/etc/glftpd.conf /etc/glftpd.conf ▐▌ █ ln -s /jail/glftpd/etc/glftpd.conf /jail/glftpd.conf ▐▌ █ ▐▌ █ The reason we link that to the two locations - different clients will look ▐▌ █ for glftpd.conf in different locations. ▐▌ █ The reason for the link (instead of copying (cp) is for reason 1. in NOTES ▐▌ █ above. ▐▌ █ ('ln -sf' option (not used here) is to force a link, for example if file ▐▌ █ exist) ▐▌ █ ▐▌ █ SECURITY STEP: ▐▌ █ `````````````` ▐▌ █ mv /jail/glftpd/etc/ftpd-dsa.pem /jail/ftpd-dsa.pem ▐▌ █ rm /jail/glftpd/etc/ftpd-dsa.pem ▐▌ █ ▐▌ █ Or if your certificate is ftpd-ecdsa.pem: ▐▌ █ mv /jail/glftpd/etc/ftpd-ecdsa.pem /jail/ftpd-ecdsa.pem ▐▌ █ rm /jail/glftpd/etc/ftpd-ecdsa.pem ▐▌ █ ▐▌ █ CONFIGURING GLFTPD: ▐▌ █ ``````````````````` ▐▌ █ NOTES: ▐▌ █ 1. Refer to the enclosed glftpd.conf-EXAMPLES and docs for all settings ▐▌ █ explained with examples given. ▐▌ █ 2. Find my complete glftpd.conf, as per this tut's example, HERE for your ▐▌ █ reference only. ▐▌ █ ▐▌ █ This is what I did: ▐▌ █ pico /jail/glftpd/etc/glftpd.conf ▐▌ █ Top line change to reflect correct path of of your ftpd-dsa.pem: ▐▌ █ Mine had this: ▐▌ █ /jail/glftpd/etc/ftpd-dsa.pem ▐▌ █ I changed it to: ▐▌ █ /jail/ftpd-dsa.pem ▐▌ █ ▐▌ █ OR if you are using ftpd-ecdsa.pem change it to: ▐▌ █ #if you have rsa cert file ▐▌ █ #RSA_CERT_FILE /glftpd/ftpd-rsa.pem ▐▌ █ #if you have dsa cert file ▐▌ █ #DSA_CERT_FILE /jail/ftpd-dsa.pem ▐▌ █ CERT_FILE /jail/ftpd-ecdsa.pem ▐▌ █ ▐▌ █ Fill in your correct site name, short name, email and root path - which ▐▌ █ would be for this install: ▐▌ █ rootpath /jail/glftpd ▐▌ █ ▐▌ █ *SKIP this for now and come back to view how I added my own messages it if ▐▌ █ you want to make 'your own' site messages. ▐▌ █ (refer to the section, further on down, 'CUSTOMIZING YOUR MESSAGES' for ▐▌ █ details on how) then add them to the glftpd.conf. For example: ▐▌ █ welcome_msg /ftp-data/misc/welcomefriends.msg =friends ▐▌ █ welcome_msg /ftp-data/misc/welcome.msg * ▐▌ █ ▐▌ █ TLS settings for your server. Details here with more options - ▐▌ █ glftpd-LNX_2.01/docs/README.TLS ▐▌ █ !* = no one / no ▐▌ █ * = everyone / yes ▐▌ █ !-dog * = except dog everyone else ok ▐▌ █ So then to force all users to secure mode only (TLS) use these settings: ▐▌ █ # TLS enforcements. ▐▌ █ userrejectsecure !* ▐▌ █ userrejectinsecure * ▐▌ █ denydiruncrypted * ▐▌ █ denydatauncrypted * ▐▌ █ ▐▌ █ In the 'stat section' you need to add the directories you created earlier ▐▌ █ in your /site/incoming. This is what I have: ▐▌ █ # SECTION # KEYWORD DIRECTORY SEPARATE CREDITS ▐▌ █ ########################################################################## ▐▌ █ stat_section DEFAULT * yes ▐▌ █ stat_section ZIPS /site/ZIPS/* no ▐▌ █ stat_section SFV /site/SFV/* no ▐▌ █ stat_section M3U /site/M3U/* no ▐▌ █ stat_section MEW /site/MEW/* no ▐▌ █ stat_section incoming /site/incoming/* no ▐▌ █ ▐▌ █ Below that is the 'rights sections'. Again refer to glftpd.conf-EXAMPLES ▐▌ █ for that easily explained. And set your how you like. ▐▌ █ ▐▌ █ Further down you'll see: ▐▌ █ free_space 20 (this means how much free space is required to grant upload ▐▌ █ permision) ▐▌ █ max_users 15 5 (How many user may be logged in at the same time) ▐▌ █ total_users 300 (Maximum accounts amount on server) ▐▌ █ ▐▌ █ Since mine is a small private site, I have changed it to: ▐▌ █ free_space 20 ▐▌ █ max_users 15 5 ▐▌ █ total_users 20 ▐▌ █ ▐▌ █ Dupe section: I don't want dupe checking in two of my directories (MEW and ▐▌ █ incoming) so I add this: ▐▌ █ dupe_check 7 no ▐▌ █ nodupecheck /site/MEW/* ▐▌ █ nodupecheck /site/incoming/* ▐▌ █ If you don't want dupe checking entire site then it would be: ▐▌ █ /site/* * ▐▌ █ Or to exclude a user or group, use this: !-username grp !=grpname ▐▌ █ (dupe checking prevents users from uploading a file of the 'same name' ▐▌ █ that is on the site even if it's in a different directory) ▐▌ █ ▐▌ █ In the '<cap 1st letter>' section I want to allow directory names to begin ▐▌ █ with a lower case and not have glftpd change it to an upper case so I ▐▌ █ change: ▐▌ █ dir_names 1 none [:space:]_ ▐▌ █ To: ▐▌ █ dir_names 0 none [:space:]_ ▐▌ █ ▐▌ █ ▐▌ █ In the Private Groups sections, I add my group MEW (that I added earlier ▐▌ █ on in this tut via site cmd) like this: ▐▌ █ privgroup STAFF My[:space:]Private[:space:]Group ▐▌ █ privgroup MEW MEW ▐▌ █ ▐▌ █ Below that in 'PRIVPATH' sections I've added the directory MEW with ▐▌ █ settings that only users in group MEW will be able to have access to it. ▐▌ █ Further more I have only allowed the groups friends to have access to the ▐▌ █ directory incoming (remember my note above about the order of dogs...the ▐▌ █ order you add this is important). I've added it like this: ▐▌ █ #privpath /site/privatedir 1 =STAFF ▐▌ █ privpath /site/MEW 1 =MEW ▐▌ █ privpath /site/incoming * ▐▌ █ privpath /site !=friends * ▐▌ █ ▐▌ █ In the CUSTOM SITE COMMANDS section I have added the other scripts I'm ▐▌ █ using. If you don't have/ aren't using these scripts then do not add them. ▐▌ █ You can add them later once they are installed correctly. For details ▐▌ █ about each script's installing procedure see below under section ▐▌ █ 'INSTALLING EXTRA SCRIPTS'. So for now I would just leave it as is and ▐▌ █ work on the scripts after you are done with this file. In any case my ▐▌ █ section looks like this: ▐▌ █ site_cmd RULES TEXT /ftp-data/misc/site.rules ▐▌ █ site_cmd LOCATE EXEC /bin/locate.sh ▐▌ █ site_cmd NFO EXEC /bin/sitenfo.sh ▐▌ █ site_cmd ZIPCHK EXEC /bin/sitezipchk.sh ▐▌ █ site_cmd ZIPLIST EXEC /bin/siteziplist.sh ▐▌ █ site_cmd NFOVIEW EXEC /bin/nfoview.sh ▐▌ █ site_cmd RARTEST EXEC /bin/rartest.sh ▐▌ █ site_cmd RARDTL EXEC /bin/rardtl.sh ▐▌ █ site_cmd INVITE EXEC /bin/invite.sh ▐▌ █ ▐▌ █ Now I need to let glftpd know who is allowed to use these scripts since I ▐▌ █ don't allow group friends to use all of them. I have added: ▐▌ █ custom-rules !8 !=friends * ▐▌ █ custom-locate !8 !=friends * ▐▌ █ custom-nfo !8 * ▐▌ █ custom-zipchk !8 * ▐▌ █ custom-ziplist !8 * ▐▌ █ custom-nfoview !8 * ▐▌ █ custom-rartest !8 * ▐▌ █ custom-rardtl !8 * ▐▌ █ custom-invite !8 * ▐▌ █ ▐▌ █ I've also changed these settings to not allow group friends acces to these ▐▌ █ cmds, for example: ▐▌ █ custom-rules !8 !=friends * ▐▌ █ custom-locate !8 !=friends * ▐▌ █ ▐▌ █ -delownip !8 !=friends * ▐▌ █ -dirs !8 !=friends * ▐▌ █ ▐▌ █ To assign master(s) of the site; enable editing of anyone's flags ▐▌ █ including all siteops via FTP, add master & their login name, for example: ▐▌ █ master mewbie DoGgie ▐▌ █ ▐▌ █ Add to bottom of file the passive port range you want your site to use and ▐▌ █ your site's IP followed by 1. ▐▌ █ For example add this: ▐▌ █ pasv_ports 10000-11000 ▐▌ █ pasv_addr 74.125.45.100 1 ▐▌ █ ▐▌ █ To allow FXP (see docs for various settings): ▐▌ █ allow_fxp yes yes yes * ▐▌ █ ▐▌ █ If you looked at my sample glftpd.conf you'll see other settings below ▐▌ █ 'allow_fxp' - all are for 'pzs-ng script'. You do not need any of these ▐▌ █ lines if you aren't going to install pzs-ng script. ▐▌ █ ▐▌ █ Done configuring glftpd.conf. ▐▌ █ ▐▌ █ USERS VIEW THEIR HOME DIRECTORY ONLY: ▐▌ █ ````````````````````````````````````` ▐▌ █ Now I want to set the home directory of friends to view /incoming/ only. ▐▌ █ Otherwise they will view /site/incoming/ . Though they will be denied if ▐▌ █ they try to enter /site/ directory (as per my settings in glftpd.conf) I ▐▌ █ don't want them to see it. Issue this cmd via site (on the server, not ▐▌ █ SSH): ▐▌ █ site change =friends startup_dir /incoming ▐▌ █ You could do this for a user as well: ▐▌ █ site change username homedir /site/ ▐▌ █ Of course you will need to add username in glftpd.conf to the correct ▐▌ █ perms. ▐▌ █ ▐▌ █ CUSTOMIZING YOUR MESSAGES: ▐▌ █ `````````````````````````` ▐▌ █ WELCOME MESSAGE AND NEWS: ▐▌ █ To do so - make copy of the relevant files, name them appropriately, edit ▐▌ █ them how you like, upload to server, add them to glftpd.conf as I've shown ▐▌ █ above in 'CONFIGURING GLFTPD'. ▐▌ █ On the server there are here: ▐▌ █ /jail/glftpd/ftp-data/text/onel.head ▐▌ █ /jail/glftpd/ftp-data/text/onel.foot ▐▌ █ /jail/glftpd/ftp-data/misc/welcome.msg ▐▌ █ /jail/glftpd/ftp-data/misc/newsfile ▐▌ █ ▐▌ █ 1. Make a copy of all files you want to edit and rename to your own name. ▐▌ █ For example: ▐▌ █ cd /jail/glftpd/ftp-data/ ▐▌ █ cp /text/onel.head /text/onelcustom.head ▐▌ █ cp /text/onel.foot /text/onelcustom.foot ▐▌ █ cp /misc/welcome.msg /misc/welcomecustom.msg ▐▌ █ cp /misc/newsfile /misc/newsfilecustom ▐▌ █ ▐▌ █ 2. Put your own welcome msg and design in your new onelcustom.head: ▐▌ █ pico /jail/glftpd/ftp-data/text/onelcustom.head ▐▌ █ ▐▌ █ 3. Same for your new onelcustom.foot and newsfilecustom. ▐▌ █ ▐▌ █ 4. Put your new names; onelcustom.head and onelcustom.foot in your new ▐▌ █ welcomecustom.msg file: ▐▌ █ pico /jail/glftpd/ftp-data/misc/welcomecustom.msg ▐▌ █ Edit to the correct path/name to those in your new onelcustom.head. For ▐▌ █ example welcomecustom.msg has this: ▐▌ █ %!/ftp-data/text/onel.head ▐▌ █ %ONEL ▐▌ █ %!/ftp-data/text/onel.foot ▐▌ █ ▐▌ █ Change to: ▐▌ █ %!/ftp-data/text/onelcustom.head ▐▌ █ %ONEL ▐▌ █ %!/ftp-data/text/onelcustom.foot ▐▌ █ ▐▌ █ pico /jail/glftpd/ftp-data/misc/newsfilecustom ▐▌ █ Enter your own news in. ▐▌ █ ▐▌ █ 5. Upload those to the server (if your editing wasn't done on the server). ▐▌ █ ▐▌ █ 6. You could add yourself on the site as a new user that belongs only to ▐▌ █ group friends. Then login as that user to view just how they would view ▐▌ █ the site. ▐▌ █ ▐▌ █ 7. Then add your new files to your glftpd.conf, with settings, as shown ▐▌ █ above in 'CONFIGURING GLFTPD'. ▐▌ █ Note: If the file 'welcomecustom.msg' doesn't exist it won't show any ▐▌ █ welcome message or give users an error. It will though still show the ▐▌ █ newsfile. ▐▌ █ ▐▌ █ SITE HELP: ▐▌ █ When users issue the cmd: site help ▐▌ █ they will receive a list of site commands. If you have other site ▐▌ █ commands you want to list here, for example the extra scripts you have ▐▌ █ installed: ▐▌ █ pico /jail/glftpd/ftp-data/help/site.help.all ▐▌ █ Add your new site cmds. ▐▌ █ At the end of this file do not hit enter key, or 'site help' will have a ▐▌ █ gap at the end of your new site cmds. ▐▌ █ ▐▌ █ INSTALLING EXTRA SCRIPTS: ▐▌ █ ````````````````````````` ▐▌ █ Optional: As per my glftpd.conf in the section 'CUSTOM SITE COMMANDS' I ▐▌ █ have extra scripts (*.sh) installed and enabled. You'll find four of these ▐▌ █ scripts in the package (tar.gz) glftpd*\bin\ or on your server here: ▐▌ █ /jail/glftpd/bin/ ▐▌ █ locate.sh : Enables users to locate files on the server ▐▌ █ sitenfo.sh : View a nfo file that is 'inside' of a zip ▐▌ █ sitezipchk.sh : Checks the integrity of a zip file ▐▌ █ siteziplist.sh : Detailed list of the files in a .zip file ▐▌ █ Note: You'll also see dated.sh - to use this see my section below 'DATED ▐▌ █ DIRECTORIES'. ▐▌ █ ▐▌ █ Very easy to use these: ▐▌ █ su ▐▌ █ To see if the scripts are already in the needed directory: ▐▌ █ ls /jail/glftpd/bin/ ▐▌ █ If you don't see the script there then, for example sitenfo.sh: ▐▌ █ cp /home/user/glftpd/bin/sitenfo.sh /jail/glftpd/bin/sitenfo.sh ▐▌ █ ▐▌ █ Scripts will either have their instructions on them or a doc included with ▐▌ █ it. ▐▌ █ If you are planning to install all of these scripts then let's copy all the▐▌ █ binaries needed: find, echo, cut, bash, unzip, rar, unrar, and cat ▐▌ █ If they are installed you will find most of them in /bin/ To view if you ▐▌ █ have them: ▐▌ █ ls /bin ▐▌ █ To view if you have the needed binaries already in the script's correct ▐▌ █ path: ▐▌ █ ls /jail/glftpd/bin/ ▐▌ █ Those that aren't there copy them over. For example I needed echo, rar, ▐▌ █ and unrar: ▐▌ █ cp /bin/echo /jail/glftpd/bin/echo ▐▌ █ rar and unrar aren't located in bin. To find the location: ▐▌ █ which rar ▐▌ █ which unrar ▐▌ █ ▐▌ █ Copy them over from the path it replied: ▐▌ █ cp /usr/bin/unrar /jail/glftpd/bin/unrar ▐▌ █ cp /usr/bin/rar /jail/glftpd/bin/rar ▐▌ █ Then I set the perms on the binaries I copied over: ▐▌ █ chmod 755 /jail/glftpd/bin/echo ▐▌ █ chmod 755 /jail/glftpd/bin/unrar ▐▌ █ chmod 755 /jail/glftpd/bin/rar ▐▌ █ Set the perms on the rest of the binaries if they aren't already 755. ▐▌ █ ▐▌ █ SITENFO.SH ▐▌ █ To view the script and to see if it has instructions on it: ▐▌ █ cat /jail/glftpd/bin/sitenfo.sh ▐▌ █ and you'll see near the top: ▐▌ █ #INSTRUCTIONS ▐▌ █ #Add the following lines to your glftpd.conf: ▐▌ █ # site_cmd NFO EXEC /bin/sitenfo.sh ▐▌ █ # custom-nfo !8 * ▐▌ █ #Make sure unzip and echo are in your binary path that is ▐▌ █ #specified below and they are chmod 755 ▐▌ █ ▐▌ █ As per the instructions; set perms on it: ▐▌ █ chmod 755 /jail/glftpd/bin/sitenfo.sh ▐▌ █ ▐▌ █ Then add it to your glftpd.conf: ▐▌ █ pico /jail/glftpd/etc/glftpd.conf ▐▌ █ Add this line with the other site_cmds: ▐▌ █ site_cmd NFO EXEC /bin/sitenfo.sh ▐▌ █ ▐▌ █ Then add the line with the other customs that will state who is allowed ▐▌ █ to use sitenfo.sh: ▐▌ █ custom-nfo !8 * ▐▌ █ ▐▌ █ LOCATE.SH ▐▌ █ Do same method for the other scripts. For the other scripts I did: ▐▌ █ cat /jail/glftpd/bin/locate.sh ▐▌ █ chmod 666 /jail/glftpd/dev/null ▐▌ █ btw this was already 666, didn't need to do it. ▐▌ █ pico /jail/glftpd/bin/locate.sh ▐▌ █ edit 'sitepath=/site' 'pathsize=5' if your installation is different. ▐▌ █ I didn't need to edit this file. ▐▌ █ ▐▌ █ ZIPCHK.SH ▐▌ █ cat /jail/glftpd/bin/sitezipchk.sh ▐▌ █ I did nothing further ▐▌ █ ▐▌ █ SITEZIPLIST.SH ▐▌ █ cat /jail/glftpd/bin/siteziplist.sh ▐▌ █ pico /jail/glftpd/etc/glftpd.conf ▐▌ █ Add this line with the other site_cmds: ▐▌ █ site_cmd ZIPLIST EXEC /bin/siteziplist.sh ▐▌ █ custom-ziplist !8 * ▐▌ █ ▐▌ █ OTHER SCRIPTS ▐▌ █ NFOVIEW.SH ▐▌ █ Other scripts that I have on my glftpd.conf that are not included with ▐▌ █ glFTPd are enabled in a similar method, for example: ▐▌ █ 1. nfoview.sh - view a text file in a directory ▐▌ █ Exit root if you are still: exit ▐▌ █ wget http://archive.glftpd.com/scripts/psxc/nfoview_v0.1.tgz ▐▌ █ tar -zxvf nfoview_v0.1.tgz ▐▌ █ See if I need to edit anything and find the lines to add to glftpd.conf: ▐▌ █ pico nfoview.sh ▐▌ █ Change site name: SITE="PSXC" and what types of files you want supported ▐▌ █ below that. ▐▌ █ su ▐▌ █ cp nfoview.sh /jail/glftpd/bin/nfoview.sh ▐▌ █ chmod 755 /jail/glftpd/bin/nfoview.sh ▐▌ █ pico /jail/glftpd/etc/glftpd.conf ▐▌ █ Add script's lines: ▐▌ █ site_cmd NFOVIEW EXEC /bin/nfoview.sh ▐▌ █ custom-nfoview !8 * ▐▌ █ ▐▌ █ exit ▐▌ █ ▐▌ █ INVITE.SH ▐▌ █ 2. invite.sh- users invite via site cmd to an IRC channel ▐▌ █ This script is an extra script included in 'pzs-ng (Project Zipscript - ▐▌ █ Next Generation)'. This is a wonderful 'zip script package' that comes ▐▌ █ with many nice extras. You don't need to use the one from pzs-ng, there ▐▌ █ are other invite scripts out there. Since I am using pzs-ng then I used ▐▌ █ the invite.sh included. You'll find it in the package HERE: ▐▌ █ project-zs-ng_r2500-v1.2.0/sitebot/extra/invite.sh ▐▌ █ This script will be executed by glftpd - not the sitebot/eggdrop. Bots ▐▌ █ only announce it, in the style set out by the 'theme' used. ▐▌ █ The instructions how to use invite.sh is included in its README: ▐▌ █ cat /home/project-zs-ng_r2500-v1.2.0/sitebot/README ▐▌ █ Add the following to glftpd.conf: ▐▌ █ site_cmd INVITE EXEC /bin/invite.sh ▐▌ █ custom-invite !8 * ▐▌ █ ▐▌ █ For instructions how to edit the invite IRC output on invite, read my ▐▌ █ 'PZS-NG ZIP SCRIPT' tutorial HERE. ▐▌ █ ▐▌ █ PZS-NG ZIP SCRIPT ▐▌ █ 3. For installing 'PZS-NG ZIP SCRIPT' I have made a separate tutorial for ▐▌ █ it HERE. ▐▌ █ ▐▌ █ MORE SCRIPTS ▐▌ █ 4. For links to others and a few scripts that I made; view section ▐▌ █ on left menu 'FTP SERVERS - LINUX & WIN / GLFTPD - SCRIPTS MINE'. ▐▌ █ ▐▌ █ UNDUPE FILES VIA SSH: ▐▌ █ ````````````````````` ▐▌ █ If you would like to have the ability to undupe files via SSH (normally ▐▌ █ done via server: site updupe file) then you'll need to compile it first: ▐▌ █ cd /jail/glftpd/bin/sources;gcc -o /jail/glftpd/bin/undupe undupe.c ▐▌ █ If it worked it won't have a reply. To see if it compiled the 'undupe' ▐▌ █ file: ▐▌ █ ls /jail/glftpd/bin/undupe ▐▌ █ If the reply is this, then it worked: /jail/glftpd/bin/undupe ▐▌ █ chmod +x /jail/glftpd/bin/undupe ▐▌ █ (chmod +x = chmod 755) ▐▌ █ Now try to undupe a file from your shell cmd, for example: ▐▌ █ /jail/glftpd/bin/undupe -f testundupe.r00 ▐▌ █ Reply will be: ▐▌ █ Trying to clear testundupe.r00 ▐▌ █ Dupe! Clearing!! ▐▌ █ ▐▌ █ DATED DIRECTORIES AUTOMATICALLY MADE: ▐▌ █ ````````````````````````````````````` ▐▌ █ crontab -e ▐▌ █ Paste in this line at the bottom: ▐▌ █ 0 0 * * * /jail/glftpd/bin/dated.sh ▐▌ █ ▐▌ █ So at this point my complete crontab is: ▐▌ █ 0 0 * * * /jail/glftpd/bin/reset -e -r /jail/glftpd.conf ▐▌ █ 0 0 * * * /jail/glftpd/bin/dated.sh ▐▌ █ ▐▌ █ Let's customize where it makes the dated directories and symlinks to them. ▐▌ █ To see if the script is already in the needed directory: ▐▌ █ ls /jail/glftpd/bin/ ▐▌ █ If you don't see dated.sh in that list then copy it over: ▐▌ █ cp /home/user/glftpd/bin/dated.sh /jail/glftpd/bin/dated.sh ▐▌ █ chmod 755 /jail/glftpd/bin/dated.sh ▐▌ █ pico /jail/glftpd/bin/dated.sh ▐▌ █ Has this: ▐▌ █ #!/bin/bash ▐▌ █ # simple script to create dated dirs ▐▌ █ # run this script as root. change paths if you're not using standard. ▐▌ █ ▐▌ █ date=`date +%m%d` ▐▌ █ #date2=`date --date '1 days ago' +%m%d` # this is just an example ▐▌ █ ▐▌ █ # the following will make sure people can't upload to old dated dirs ▐▌ █ chmod o-w /glftpd/site/incoming/* ▐▌ █ ▐▌ █ # this will create a new dated dir ▐▌ █ mkdir /glftpd/site/incoming/$date ▐▌ █ chmod 777 /glftpd/site/incoming/$date ▐▌ █ ▐▌ █ # This will create a 'today' link to today's dated directory ▐▌ █ cd /glftpd/site ▐▌ █ rm today ▐▌ █ ln -s ./incoming/$date today ▐▌ █ ▐▌ █ Change to (note the # is removed before date2), adding the paths (that ▐▌ █ are already in your glftpd.conf of course) where you want to have the ▐▌ █ dated directories made: ▐▌ █ #!/bin/bash ▐▌ █ # simple script to create dated dirs ▐▌ █ # run this script as root. change paths if you're not using standard. ▐▌ █ ▐▌ █ date=`date +%m%d` ▐▌ █ date2=`date --date '1 days ago' +%m%d` # this is just an example ▐▌ █ ▐▌ █ # the following will make sure people can't upload to old dated dirs ▐▌ █ chmod o-w /jail/glftpd/site/ZIPS/* ▐▌ █ ▐▌ █ # this will create a new dated dir ▐▌ █ mkdir /jail/glftpd/site/ZIPS/$date ▐▌ █ chmod 777 /jail/glftpd/site/ZIPS/$date ▐▌ █ ▐▌ █ # This will create a 'today' link to today's dated directory ▐▌ █ cd /jail/glftpd/site ▐▌ █ rm ZIPS-Today ▐▌ █ ln -s ./ZIPS/$date ZIPS-Today ▐▌ █ ▐▌ █ cd /jail/glftpd/site ▐▌ █ rm ZIPS-Yesterday ▐▌ █ ln -s ./ZIPS/$date2 ZIPS-Yesterday ▐▌ █ ▐▌ █ chmod o-w /jail/glftpd/site/M3U/* ▐▌ █ ▐▌ █ mkdir /jail/glftpd/site/M3U/$date ▐▌ █ chmod 777 /jail/glftpd/site/M3U/$date ▐▌ █ ▐▌ █ You don't need to add this to glftpd.conf as it will run from crontab ▐▌ █ every midnight now. ▐▌ █ You can test it right now by running dated.sh: ▐▌ █ /jail/glftpd/bin/./dated.sh ▐▌ █ That will make a directory in the paths you specified that is named after ▐▌ █ the date of today and create your symlinks. ▐▌ █ ▐▌ █ WE ARE DONE :) ! ▐▌ █ ▐▌ █ GLFTPD LOGS: ▐▌ █ ``````````` ▐▌ █ To handle all of GLFTPD logs view my tutorial HERE. ▐▌ █ ▐▌ █ ▐▌ █ //---------------------------------------------------------------------- ▐▌ █ ▐▌ █ If you find mistakes, have suggestions, and or questions please post at ▐▌ █ mewbies forum HERE - thank you. ▐▌ █ ▐▌ █ Last update on 05 Mar '14 ▐▌ █ ▐▌ █▌ █▌ █▌ - mewbies.com - █▌ █▌ █▌ ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██