setup
1. update sources.list due to EOL of Debian 4
$ vi /etc/apt/sources.list
#deb http://ftp.nz.debian.org/debian lenny main
#deb-src http://ftp.nz.debian.org/debian lenny main
#deb http://security.debian.org lenny/updates main contrib
#deb-src http://security.debian.org lenny/updates main contrib
deb http://archive.debian.org/debian/ lenny main non-free contrib
deb-src http://archive.debian.org/debian/ lenny main non-free contrib
deb http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
deb-src http://archive.debian.org/debian-volatile lenny/volatile main contrib non-free
deb http://archive.debian.org/debian-backports lenny-backports main contrib non-free
deb http://archive.debian.org/debian-security lenny/updates main
$ apt-get update
2. install proftpd
$ apt-get install proftpd
(choose standalone from standalone or inet)
3. configure proftpd
$ vi /etc/proftpd.proftpd.conf
DefaultRoot ~
<Limit LOGIN>
AllowUser USER-A
AllowUser USER-B
DenyALL
</Limit>
see /etc/proftpd/proftpd.conf for more information.
4. create a ftp account
$ useradd <USER-NAME> -s /bin/false -d <PATH-TO-DIR>
$ passwd <USER-NAME>
(type password twice)
how to add a ftp account
1. create a new account
$ useradd <USER-NEW> -s /bin/false -d <PATH-TO-DIR>
$ passwd <USER-NEW>
(type password twice)
* this user can't ssh into a machine as its shell is "/bin/false".
2. allow it to ftp-login
$ vi /etc/proftpd/proftpd.conf (or open the file by another software)
<Limit LOGIN>
AllowUser <USER-A>
AllowUser <USER-B>
AllowUser <USER-NEW> <----- add this line
DenyALL
</Limit>
3. load new configuration by restarting daemon
$ /etc/init.d/proftpd restart
how to delete a ftp account
1. delete a ftp account
$ userdel <USER-NEW>
2. disallow it to ftp-login
$ vi /etc/proftpd/proftpd.conf (or open the file by another software)
<Limit LOGIN>
AllowUser <USER-A>
AllowUser <USER-B>
AllowUser <USER-NEW> <----- delete this line
DenyALL
</Limit>
3. load new configuration by restarting daemon
$ /etc/init.d/proftpd restart