FTP Server (bftpd)
Preparation
- Perform this stage using your functioning PC.
- Download the bftpd source code from bftpd.sourceforge.net.
- Visit bftpd.sourceforge.net and click on the "Downloads" link.
- Click on the link for the source code tarball of the latest version of bftpd.
- At the time of writing the latest version of bftpd was version 1.0.22, so the file downloaded was
bftpd-1.0.22.tar.gz.
- At the time of writing the latest version of bftpd was version 1.0.22, so the file downloaded was
- You will be asked to where you wish to save the file. Chose a safe place and make a note of it.
- The download is about 71kb and will take only a few seconds over a modem connection, and a lot less over a broadband connection.
- If you are using a download accelerator program, it will save the file to your default download directory.
- Burn the file
bftpd-1.0.22.tar.gzto a CD. This page assumes that the subdirectory/appsis used for the.tar.gzfile. The CD-ROM can be a multi-session disk.- Use your CD burning software to create an ISO9660 disc image with the file
bftpd-1.0.22.tar.gzin the/appsdirectory. - Burn the CD and verify the data stored on it.
- Use your CD burning software to create an ISO9660 disc image with the file
Booting
- Perform this stage and subsequent stages, unless otherwise stated, using your Core Linux PC.
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.- Wait for the following text to appear:
localhost login: - Type
rootand press Enter. - The screen will display this message:
Password: - Enter the password for
rootthat you set earlier. - You will be shown a prompt that looks like this:
[~]#
- Wait for the following text to appear:
Extract the source
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom.- At the prompt enter:
mount /dev/hdb /mnt/cdrom - You will see the following line appear:
mount: block device /dev/hdb is write-protected, mounting read-only
- At the prompt enter:
- Change to the
/appsdirectory on the CD-R.- At the prompt enter:
cd /mnt/cdrom/apps - The prompt will change to:
[/mnt/cdrom/apps]#
- At the prompt enter:
- Copy the
bftpd-1.0.22.tar.gzfile to the directory/usr/src.- At the prompt enter:
cp bftpd-1.0.22.tar.gz /usr/src - The system will not display a message if everything is OK.
- At the prompt enter:
- Change to the
/usr/srcdirectory and extract the source from the.tar.gzfile.- At the prompt enter:
cd /usr/src - The prompt will change to:
[/usr/src]# - At the prompt enter:
tar -zxvf bftpd-1.0.22.tar.gz - A long stream of unzipping files and directories should scroll up the screen for a few seconds.
- At the prompt enter:
Configure and compile
- Change to the
/usr/src/bftpd-1.0.22directory.- At the prompt enter:
cd bftpd-1.0.22 - The prompt will change to:
[/usr/src/bftpd-1.0.22]#
- At the prompt enter:
- Run the
./configurescript.- At the prompt enter:
./configure - A stream of processes should scroll up the screen for about twenty seconds.
- The script finishes with the line:
creating config.h
- At the prompt enter:
- Run the
makeprogram.- At the prompt enter:
make - A stream of processes should scroll up the screen for about twenty seconds.
- The program finishes with the line:
gcc bftpdutmp.o commands.o commands_admin.o dirlist.o login.o logging.o main.o mystring.o options.o -lcrypt -o bftpd
- At the prompt enter:
- Run the
makeprogram with the argumentinstall.- At the prompt enter:
make install - A stream of processes should scroll up the screen for a few seconds.
- The program finishes with the line:
chmod 644 /var/log/bftpd.log
- At the prompt enter:
Setting up bftpd
- Create the file
/var/run/bftpd/bftpdutmp.- At the prompt enter:
mkdir /var/run/bftpd - The system will not display a message if everything is OK.
- At the prompt enter:
touch /var/run/bftpd/bftpdutmp - The system will not display a message if everything is OK.
- At the prompt enter:
- Configure a user for FTP access. By default, the user
ftpis allowed anonymous logon. No password needs to be set. This prevents the user from logging on at the terminal. Other users require a valid username and password combination for access to the system.- Add the user
ftp.- At the prompt enter:
useradd ftp - The system will not display a message if everything is OK.
- At the prompt enter:
- Set a password for the FTP user.
- At the prompt enter:
passwd ftp - The screen will change to show:
Changing password for ftp
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
New password: - Enter the password. The screen will change to show:
Re-enter new password: - Re-enter the password. The screen will change to show:
Password changed.
- At the prompt enter:
- Add the user
- Create the home directory for the FTP user.
- At the system prompt enter:
mkdir /home/ftp - The system will not display a message if everything is OK.
- At the system prompt enter:
Starting bftpd
- Start the bftpd server using
bftpd -d.- At the prompt enter:
/usr/sbin/bftpd -d - The system will not display a message if everything is OK.
- At the prompt enter:
- Using your other computer, see if you can access the FTP server.
- Launch your ftp client.
- Open a connection to the IP address 192.168.0.10. How you do this will vary from client to client.
- When prompted, enter the username and password of the new FTP user. You should then be given access to the home directory of your FTP user.
Stopping bftpd
- Stop the bftpd server using
kill.- At the prompt enter:
ps -A - The screen will show a list of the processes currently running. Look for the line containing
bftpdand note the PID number. - At the system prompt enter:
where
kill PIDPIDis the PID value obtained previously. - The system will not display a message if everything is OK.
- At the prompt enter:
Automating bftpd
- This section details how to have your bftpd server start automatically when the computer boots. The advantage of this method is that you do not have to log in to start bftpd. If you wish to start bftpd manually after each reboot then skip this section.
- Append the following line to the
/etc/rc.d/rc.muscript:You can also add comments and echoes for your own information.bftpd -d- At the prompt enter:
nano /etc/rc.d/rc.mu - The screen will show the contents of
/etc/rc.d/rc.muwith information about the file at the top and bottom of the screen. - Add the following text to the end of the file:
# Start bftpd
/usr/sbin/bftpd -d
echo bftpd started - Save the file and exit the text editor.
- Press Ctrl+x on the keyboard.
- The contents of the white line at the bottom of the screen will change to read:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? - Type
y. - The contents of the white line at the bottom of the screen will change to read:
File Name to write: /etc/rc.d/rc.mu - Press Enter.
- You will be returned to the system prompt.
- At the prompt enter:
- Reboot the system and check that bftpd is running.
- At the system prompt enter:
shutdown -r now - Wait for the system to reboot.
- As the system reboots, watch for any error messages.
- Once the system has rebooted, try to access the FTP server using the FTP client on your other PC.
- At the system prompt enter:

The text of this page is licensed under a Creative Commons License.
