FTP is a File Transfer Protocol, which is also very common. For an important application of this Protocol-the FTP server, we also need to master it. So today we will introduce how to build an FTP server.
The basic function implemented by the FTP server is upload and download. The following describes several steps to build a simple FTP server that can implement the download function.
Build an FTP server 1. install an FTP server
If you do not select to install the FTP server when installing the system, you can install it using the "Add/delete application" tool in Red Hat 9.0. Select "Main Menu"> "system settings"> "Add/delete application", select the FTP server on the displayed page, and click "Update.
If you cannot confirm whether the software is installed, run the following command:
#rpm -qa|grep vsftpd
vsftpd-1.1.3-8
Build an FTP server 2. Start an FTP server
Use the default example of Red Hat 9.0 to directly start VSFTP.
# /sbin/service vsftpd start
Start vsftpd For vsftpd: [OK]
Create an FTP Server 3. Create a file named test.txt under/var/ftp/pubdirectory with the file content "This is a test file ".
Build an FTP server 4. Test
Use the FTP client to log on to the local server, and then use the anonymous identity anonymous) to log on:
# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 (vsFTPd 1.1.3)
Name (127.0.0.1:root): anonymous
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
In this way, you can successfully log on to the FTP server. The server directory list is displayed as follows:
ftp> ls
227 Entering Passive Mode (127,0,0,1,63,15)
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 4096 Dec 04 01:35 pub
226 Directory send OK.
Switch to the pubdirectory and display the directory content. You can find the created file test.txt: