WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: HowTo: TinyCore as multi-user FTP server  (Read 575 times)

Offline julcar

  • Jr. Member
  • **
  • Posts: 66
HowTo: TinyCore as multi-user FTP server
« on: July 23, 2019, 03:47:51 AM »
Here is my first "HowTo", and it deserves a post because the amount of time I spent trying to figure out some steps of this tutorial.

First, as you may know, TinyCore is a single-user linux, that means, only the tc user is available to login and use the OS.

I was looking for a proper way to get a multi-user FTP environment, of course using TinyCore, then I decided to use BFtpD as FTP server, because his docs are easy to read and understand, even for people like me, with less than average linux knowledge.

First let's say a true: Bftpd does not offers a strong security, but for what I want, is enough.

Good, let's suppose you have already Bftpd installed but not running, you can get rid of the default bftpd.conf file and create a yours.

I use persistent /opt and /home folders, I planned to use the following directory tree:

/opt
  /ftpusers for store the virtual users home dir
  /conf for store my custom bftpd.conf

here is my custom bftpd.conf file:

Code: [Select]
global {
  DENY_LOGIN="no"
  RATIO="none"
  INITIAL_CHROOT="/opt/ftpusers"
  AUTO_CHDIR="/"
  FILE_AUTH="/userlist.txt"
  DO_CHROOT="yes"
}

Since other config options are omitted, they takes their default values.

Here I want to remark on the INITIAL_CHROOT variable, as setting this to a physical path, now any other path in the config file will be relative to the path assigned to INITIAL_CHROOT, this thing made me crazy and take a couple of hours to figure out  :o

Now the path /opt/ftpusers is our new Root dir, the next step is to create the file that will contain the virtual users, that file is userlist.txt

Code: [Select]
admin mySecretPass users /
julcar yetAnotherPass users /julcar

and save it into /opt/ftpusers.

Now, I can safely create my home directory /opt/ftpusers/julcar (remember, /julcar from the jail point of view) and start running the server

Code: [Select]
sudo bftpd -d -c /opt/conf/bftpd.conf

Done! now you can login as admin and since this user has access to the root directory and to the userlist.txt file, can create, modify and delete users from any ftp client.

Please review and comment!

Regards