|
|
|
|
---
|
|
|
|
|
layout: post
|
|
|
|
|
status: publish
|
|
|
|
|
published: true
|
|
|
|
|
title: How to configure ftpd -- proftpd
|
|
|
|
|
author:
|
|
|
|
|
display_name: ''
|
|
|
|
|
login: ''
|
|
|
|
|
email: ''
|
|
|
|
|
url: ''
|
|
|
|
|
wordpress_id: 337
|
|
|
|
|
wordpress_url: http://blog.10ninox.com/2008/11/23/how-to-configure-ftpd-proftpd/
|
|
|
|
|
date: '2008-11-23 20:37:03 +0700'
|
|
|
|
|
date_gmt: '2008-11-24 01:37:03 +0700'
|
|
|
|
|
categories:
|
|
|
|
|
- linux
|
|
|
|
|
tags: []
|
|
|
|
|
---
|
|
|
|
|
<p>I'm planing to write Unix 101 -- beginner for beginner. Since I started getting into shell much more than GUI, I liked how simple Unix is. However, I'm no pro as Unix user; Thus, I probably have an idea what Unix 101 should be like much more than reading through Unix manual indeed.</p>
|
|
|
|
|
<p>By the way, after trying Windows Server 2008 standard for a month or so, I found that there were too many hassles involved. It was good to have GUI or wizard to walk through but sometimes it just gave us more confuse. Believe it or not, I can't even get FTP server on IIS work properly :-( Although the alternative, like FileZilla server, works flawlessly, it's just not right using 3rd party while using server edition and that's already equipped with FTP server. It's just like using Apache HTTPd on Windows server; why just use IIS or just change to Linux box for good =)</p>
|
|
|
|
|
<p>So I choose to have less complicated way--Ubuntu. Well, the reason why I choose Ubuntu is nothing but easiest. In Ubuntu server 8.10, there is no ftpd by default for whatever reason. So adding one of them is a must. Because There are many many choices, I don't know what is good too. I just choose <em>proftpd</em> and I find that's easy to configure. That's simple.</p>
|
|
|
|
|
<p>Firstly, install it! -- remember this is Ubuntu--it's debian. Your distro might use something else, but that differs when installing only.</p>
|
|
|
|
|
<p class="codebox">$ sudo apt-get install proftpd</p>
|
|
|
|
|
<p>Done with ftpd installation. That's easy, isn't it? Then we have to do configuration, briefly we have to:-</p>
|
|
|
|
|
<ol>
|
|
|
|
|
<li>manage user</li>
|
|
|
|
|
<li>edit proftpd.conf</li>
|
|
|
|
|
<li>start/restart proftpd</li>
|
|
|
|
|
</ol>
|
|
|
|
|
<p>For managing user, you might use the same account in OS, so that you don't have to do a thing in this step, but if you want to use isolated user for extra security (?!?), go for it.</p>
|
|
|
|
|
<p class="codebox">useradd [ -u uid ][ -g gid ][ -G gid [,gid,.. ]][ -d dir ][ -m ][ -s shell ][ -c comment ] loginname</p>
|
|
|
|
|
<p>You could just have only parameter you want, then the rest would be default value</p>
|
|
|
|
|
<p class="codebox">$ sudo useradd -d /home/ftp ftpuser</p>
|
|
|
|
|
<p>$ sudo passwd ftpuser //for creating password for ftpuser</p>
|
|
|
|
|
<p>For configuring our ftpd, here is the most important part--editing /etc/proftpd/proftpd.conf. In my case, I have login thru ssh, so no GUI no gedit no mousepad, nano is my first choice of text-editor here. You guys might us different one as you like.</p>
|
|
|
|
|
<p class="codebox">$ sudo nano /etc/proftpd/proftpd.conf</p>
|
|
|
|
|
<p>what you need to configure basicly are the following:-</p>
|
|
|
|
|
<pre name="code" class="c-sharp">
|
|
|
|
|
ServerName            "10nas"
|
|
|
|
|
ServerType            standalone
|
|
|
|
|
# Set the user & group server
|
|
|
|
|
# normally runs at.
|
|
|
|
|
User                nobody
|
|
|
|
|
Group                nogroup
|
|
|
|
|
# Set default root as a NAS
|
|
|
|
|
DefaultRoot /mnt/nas
|
|
|
|
|
# This is for keeping FTP user
|
|
|
|
|
# inside DefaultRoot only!
|
|
|
|
|
DefaultRoot ~
|
|
|
|
|
# Valid Logins
|
|
|
|
|
<Limit LOGIN>
|
|
|
|
|
AllowUser x1
|
|
|
|
|
AllowUser x2
|
|
|
|
|
AllowUser x3
|
|
|
|
|
AllowUser x4
|
|
|
|
|
DenyALL
|
|
|
|
|
</Limit>
|
|
|
|
|
MaxLoginAttempts 3
|
|
|
|
|
# well, <Directory> /mnt/nas> looks weird,
|
|
|
|
|
# but it's not a typo!
|
|
|
|
|
<Directory> /mnt/nas/>
|
|
|
|
|
# This is basic security for initial
|
|
|
|
|
# file permission
|
|
|
|
|
Umask 022 022
|
|
|
|
|
AllowOverwrite on
|
|
|
|
|
    <Limit ALL>
|
|
|
|
|
    Order Allow,Deny
|
|
|
|
|
    AllowUser x1
|
|
|
|
|
    AllowUser x2
|
|
|
|
|
    AllowUser x3
|
|
|
|
|
    AllowUser x4
|
|
|
|
|
    Deny ALL
|
|
|
|
|
    </Limit>
|
|
|
|
|
</Directory>
|
|
|
|
|
</pre>
|
|
|
|
|
<p>Commands to start/stop/restart the service is similar to any service</p>
|
|
|
|
|
<p class="codebox">$ sudo /etc/init.d/proftpd start<br />
|
|
|
|
|
$ sudo /etc/init.d/proftpd stop<br />
|
|
|
|
|
$ sudo /etc/init.d/proftpd restart</p>
|
|
|
|
|
<p>Well, this should be enough for setting up basic FTP server securely. =)</p>
|