Become The Solution Chicago Logo

Install glFTPd Free FTP Server Software for Mac X

Install glFTPd Free FTP Server Software for Mac X
GLFTPD is an extremely lightweight, powerful, and reliable free FTP server application designed for *NIX based systems. As of today, GLFTPD is one of the only free options for free FTP server software to be used on the latest version of Mac X (10.11 El Captain). GLFTPD uses the latest security wrappers for SSL. GLFTPD continues to receive updates today.
 
This guide demonstrates how to quickly setup GLFTPD on your Mac, create a user and add to a group, create some basic directories and files to connect to, and harden your GLFTPD security settings. At the end of this guide, you will have a fully functional FTP server running with a user created to access 2 folders.
 
 

Instructions for Mac OS High Sierra 10.13.3

 

In order to get GLFTPD v2.08 working on Mac OS 10.13.3 and accept outside connections, you must edit the eu.glftpd.glftpd.plist file the GLFTPD install script creates located inside the following path.

 

\Library\LaunchDaemons\eu.glftpd.glftpd.plist

 

Under SockFamily change IPv6 to IPv4. Follow the guide below and make sure the Mac OS X firewall is allowing the GLFTPD application if you are behind a firewall.

 

Glftpd mac os x plist launch daemon

 

Note: You may need to edit permissions on the eu.glftpd.glftpd.plist file after you made the change.

 

sudo chown root /Library/LaunchDaemons/eu.glftpd.glftpd.plist

 

To load and unload GLFTPD, use the following commands:

 

sudo launchctl load /Library/LaunchDaemons/eu.glftpd.glftpd.plist
sudo launchctl unload /Library/LaunchDaemons/eu.glftpd.glftpd.plist
 
 
Step 1: Download & Install GLFTPD
 
Head to GLFTPD.com and download the latest version for glFTPd v2.06.2 for MacOSX (x64)
 
This will download a file called glftpd-OSX-2.06.2_1.0.2f_x64.tgz onto your desktop. Double-click this file to extract the contents. You will have your GLFTPD installation files in a folder shown below.
 
GLFTPD Installation Files Mac
 
By default, GLFTPD will install to your Hard Drive root. For this guide, we will want to install GLFTPD into a folder on our desktop. Create a folder on your desktop called Server.
                                
Next, open Terminal in Applications -> Utilities -> Terminal. Type sudo and a space – then drag file installgl.sh from the glftpd installation folder into the terminal Window shown below. Hit enter.
 
Install GLFTPD SH Script
 
You will be prompted for your Mac X account user password in Terminal – enter it. As soon as you do, you should receive the GLFTPD Installer prompt (Darwin). Follow the reaming steps below.
 
Press to continue.Hit Enter.
 
GLFTPD will look to see if you have a compiler installed. If you don’t you will receive a prompt to download and install xcode-select. Select install and agree to terms.
 
Mac X GLFTPD Xcode Select Install
 
After xcode-select is installed, hit the up arrow in terminal and the enter to restart the GLFTPD installation. You should now get past the compiler step.
Use a Jailed environment? [Y]es [N]o: Select Y
Please enter the private directory to install glftpd inside [/jail]: Drag the Server folder you made on your desktop into the terminal Window. You will receive path already exists just hit I for ignore.
 
Use a private group? [Y]es [N]o: Select N
 
Please enter the directory inside /Users/louk/Desktop/Server to install glftpd to [/glftpd]: Just hit return
 
Enter a service name for glftpd. Just hit return to use glftpd default name.
 
Note: The next screen will show the various source files compiling. For the purpose of this guide, we aren’t as concerned if these compile or not because we won’t be setting a lot of that functionality up anyhow.
Enter the port you would like glftpd to listen on [1337]: Make this a high port. You never want to use default FTP ports. Let’s use 57776.
 
For the European weeks, you can select No N.
Please specify location, inside /Users/Hard Drive/Desktop/Server/glftpd,
to install the cert (ftpd-dsa.pem) [/etc]: Hit return.
 
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): Name the certificate something – we will call it NEW.
 
Press to continue
 
And finally, you should see a screen that GLFTPD is started automatically. Done!
 
 
Recap: We just successfully installed GLFTPD into our Server folder on our desktop. We also added gltfpd as a service to the Mac X services file (/etc/services) as it appears at the bottom for the list as glftpd 57776/tcp. We also created a LaunchDaemon to start GLFTPD each time the computer is booted in /Hard Drive/Library/LaunchDaemons/eu.glftpd.glftpd.plist
 
 
Step 2: Test Your New GLFTPD Server and Create a User
 
In Terminal, let’s connect to our FTP server. Type: ftp 127.0.0.1 57776
 
Type: glftpd / glftpd This is the default account that comes with GLFTPD.
 
You should now be logged into your FTP server. Let’s create our first user. The format is site adduser NAME PASS IDENT @ IP.MASK
 
Type: site adduser rob password123 *@*. This creates our user rob with password123 and no restriction of an IP address.
 
Type: site change rob flags +12. This gives user rob siteop, gadmin, and view user privileges. It’s essential maximum privileges we will want for now. This will also allow rob to create new FTP users. For more on GLFTPD flags visit here.
 
Type: site grpadd NEW. This creates a new group NEW that we will add other users to and set permissions on, so as to not worry about setting permission on every subsequent account.
 
Type: site grpchange NEW slots 10. Allow group NEW to have 10 dl/ul slots.
 
Type: site chgrp rob NEW. Adds rob to NEW group.
 
Done. You can quit Terminal or type bye to exit.
 
 
Step 3: Connect to Your FTP Server Using FTP Client on Another Machine
 
There are several free FTP clients you can use to connect to your FTP server too. There is Fetch, Cyberduck, and FileZilla. Whichever client you decide to use, the following settings will be required to establish a succesfull connect.
 
FTP Using Explisit SSL (Auth SSL)
Host IP Address: (External and or Local IP of the GLFTPD Server)
Port: 57776
Username: rob (case sensitive)
Password: password123
 
On your first successful connection, you will be required to Accept & Save the SSL Certificate you created.
 
Note: If you are unable to login to your FTP server, check the following.
 
*Ensure the necessary ports are setup on your router. In this example, our FTP server host is setup in a DMZ so all ports are opened. Ensure you forwarded 57776/TCP otherwise.
 
*Ensure Mac X Firewall is turned off OR is allowing GLFTPD incoming connections. Check in System Preferences -> Security & Privacy -> Firewall
 
*If you connect but get PASV mode failed per below:
[R] Data Socket Error: Connection refused
[R] List Error
[R] PASV mode failed, trying PORT mode.
 
Ensure your router isn’t forwarding PASV ports to another destination address which would cause these ports to not forward correctly. We will lock down the PASV port range in GL config later.
 
 
Step 4: Build Your FTP Server Directories
 
The fun part. Let’s start creating some folders for our new user to view, upload, and download from. We will make it easy and create folders the way Mac X does.
 
Navigate to your FTP root directory /Server/glftpd/site. In here you can create folders that user rob will be able to see. You can also add files to the folders. Create 2 folders: Upload and Download.
 
 
The next part we will allow necessary permissions for this folders, respectively.
 
Note: In GLFTPD, you should create all directories with 777 or 755 permissions. 777 gives users upload and 755 is access to. For instance, in Terminal you could type mkdir –m 755 /Server/glftpd/site/Upload and mkdir –m 777  /Server/glftpd/site/Download
 
 
Step 5: Harden Your GLFTPD Config File
 
Open glftpd.conf in /Server/
 
Let’s force all users connecting to use TLS encryption as security is most important to use. Edit the following section accordingly.
 
Meaning:
 
!*      = no one / no
*       = everyone / yes
!-rob*  = except rob everyone else same
 
Edit these switches here:
 
glftpd tls enforcements
 
 
Next, let’s give permissions to the folders we created earlier. We will set the permissions for the group NEW. Go to THE RIGHTS SECTION BEGINS HERE and edit the following lines.
 
GLFTPD User Rights
 
Finally, let’s limit the PASV port range GLFTPD chooses. Limiting the random PASV ports used helps improve security. Add the following lines to the end of you glftpd.conf file.
 
pasv_ports 50000-51000 (Ensure these ports are forwarded on router)
pasv_addr X.X.X.X 1 (This is your server external IP Address and append the 1 at end)
 
 
Step 6: Manage Your GLFTPD Server
 
At this point, you’ve successfully created your FTP server. Remember, you can connect to your FTP server in Terminal to issue commands. Another FTP client that lets you send raw commands and do management the same time is FlashFXP.
There is a GUI Windows client you can use to easily manage your GFLFTPD called glFTPd Administrator. If you use WineBottler for Mac, you can run GLFTPD Administrator in Mac as well (as well as FlashFXP, both have been tested with latest version of WineBottler).
 
Note: GLFTPD Administrator does not support SSL encryption at this time, so you need to create an account that doesn’t force TLS in GLFTPD.
 
If you ever need to turn off or temporarily shut down your GLFTPD server, edit the following line in glftpd.conf. You would uncomment the shutdown switch show below.
 
GLFTPD Shutdown Offline Server
 
 
 
List of GLFTPD Site Commands (referenced here)
 
FILES:
``````
site dupe [-max ] [-from ] [-to ] [ ... ]
site fdupe [-max ] [-from ] [-to ] [ ... ] {searches ftp-data/logs/dupelog
site chmod {chmod a file
site locate {locate a file
site nuke {nuke
site nukes {display recently nuked releases
site unnuke {unnuke a directory
site unnukes {recently unnuked releases
site new {display 10 newest created directories (taken from dirlog)
site new [.] [<#>]
site new . 20 {show latest 20 new directories in the current dir tree
site new 40 {show the 40 newest directories everywhere
site request [] {add/display requests
site reqfilled <#> {fill a request.
site search [ ...] {search site for matching directory names read from ftp-data/logs/dirlog
site undupe {remove filename(s) from ftp-data/logs/dupefile
site predupe {adds to the dupefile database, so that it can't be uploaded
site wipe [-r] {rm a directory without users losing credits and stats
site xdupe [mode] {displays mode of xdupe
GROUPS:
```````
site chgadmin {gadmin user for group x
site chgrp [] {adds/removes a user from group(s)
site gadduser {adds a user and changes his/her group to
site ginfo {detailed info on a group
site group {display groups you are in
site group [] {leave/join a group
site groups {list available groups
site grp {group info
site grpchange {display variables for this cmd
site grpadd [] {add a new group
site grpdel {delete a group
site grpren {rename a group.
site grpnfo {change description for a group
USERS:
``````
site adduser
site addip
site change {list variables - change a field for a user
site chpass {change users password
site passwd {change your password
site deli dent @ ip> {remove an IP/s from x user
site deluser {delete a user, may be readded with site readd
site emulate {load user's userfile into your process' memory
site flags {list your flags
site flags {list user's flags
site give [gGmM] [] {gives credits to user-taken from you
site take [gGmM] [] {removes credit from user
site kick {kill connection for user
site kill {kill a pid
site purge {remove all users who have the deleted flag
site purge [] {remove user that has a deleted flag
site readd {show list of users with deleted flag
site readd [] {removes deleted flag from user
site renuser {rename a user
site show {userfile in raw format
site users deleted { "            "
site user {list all users
site user [] {detailed info about a user
site users {list all users with some details
site users [keyword|flag|=group|usernam*]
site laston [num] [-user] [=group] [type] {display last on
site seen {shows when a user was last online
site swho {detailed information about users online
site who {users currently online
LOGS:
`````
site errlog [] [] {display the error log
site logins [] [] {display failed logins read from /glftpd/ftp-data/logs/login.log
site reqlog [] [] {show the log of filled requests read from /glftpd/ftp-data/logs/request.log
site syslog {display ftp-data/logs/sysop.log
site syslog [] [] {variables
site syslog 10 deleted {show last 10 entries containing deleted
site update {adds all dirs in current directory to dirlog (for "site new")
STATS:
``````
site aldn [number] [
] [<=group>]
site alup [number] [
] [<=group>]
site dayup [number] [
] [<=group>]
site daydn [number] [
] [<=group>]
site monthup [number] [
] [<=group>] {monthtop upload
site monthdn [number] [
] [<=group>] {monthtop download
site nuketop [number] [
] [<=group>] {alltime nuketop
site wkup [number] [
] [<=group>] {weektop uploaders
site wkdn [number] [
] [<=group>] {weektop downloaders
site gpal [number] [
] {alltime group upload
site gpmonthup [number] [
] {month group upload
site gpmonthdn [number] [
] {month group download
site gpwk [number] [
] {weektop group upload
site gpwd [number] [
] {weektop group download
site gpad [number] [
] {alltime group download
site stats [] {display a user's upload/download statistics read from /ftp-data/text/user.stats
site traffic {total uploads/downloads by all existing users in all sections
MISC SITE:
``````````
site alias {current aliases available
site cdpath {current cdpaths
site color [on/off/show] {enable/Disable the use of colors.
site help {shows site commands
site idle {your current idle settings
site idle [] {set per session idle time
site msg {show message variables
site onel [] {show/Add oneliner.
site rules
site stat {current status line.
site tagline [] {shows/sets your tagline                
site time {current time on the site.
site vers {show glftpd version
site welcome {display the welcome screen.
FROM PZS-NG:
````````````
site invite {invite user to IRC site channel
site rescan {rescan current directory
site audiosort {sort audio links
CUSTOM COMMANDS ADDED:
``````````````````````
site nfo {view an .nfo in a zip file
site nfoview {view a text file in directory
site nfox {extract an .nfo file from a zip
site rardtl {show files in a rar set including compression
site rartest {re-test integrity of a rar set
site rescan2 {run total-rescan in x dir
site zipchk {re-test integrity of a zip file
site ziplist {show files in a zip
site unzip {decompress a zip
FLAGS:
``````
Flagname        Flag    Description
-------------------------------------------------------------
siteop          1       User is siteop
GADMIN          2       User is Groupadmin
GLOCK           3       User cannot change group
EXEMPT          4       Allows to log in when site is full
color           5       Enable/Disable the use of color (toggle with "site color")
DELETED         6       User is deleted
USEREDIT        7       "Co-Siteop"
ANON            8       User is anonymous (per-session like login)
*NOTE* If you have flag 1 then you DO NOT WANT flag 2
NUKE            A       User is allowed to use site NUKE
UNNUKE          B       User is allowed to use site UNNUKE
UNDUPE          C       User is allowed to use site UNDUPE
KICK            D       User is allowed to use site KICK
KILL            E       User is allowed to use site KILL/SWHO
TAKE            F       User is allowed to use site TAKE
GIVE            G       User is allowed to use site GIVE
USERS/USER      H       This allows you to view users ( site USER/USERS )
IDLER           I       User is allowed to idle forever
 
Example: site change user flags +4ABCI

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Guest
Wednesday, 06 July 2022