用Linux系统构建高效FTP服务器
2008-10-13 00:00:00 来源:WEB开发网# /sbin/service vsftpd start
为vsftpd启动vsftpd: [确定]
3.在/var/ftp/pub目录下创建一个名为test.txt的文件,文件内容为“This is a test file”。
4.测试
使用FTP客户端登录到本地服务器,然后以匿名身份(anonymous)登录:
# 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.
这样就成功地登录到FTP服务器。可以显示服务器目录列表如下:
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.
切换到pub目录下,并显示目录内容,可以找到刚才创建的文件test.txt:
ftp> cd pub
250 Directory successfully changed.
ftp> ls
227 Entering Passive Mode (127,0,0,1,232,34)
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 21 Dec 04 01:35 test.txt
226 Directory send OK.
下载test.txt文件:
ftp> mget test.txt
mget test.txt? y
227 Entering Passive Mode (127,0,0,1,186,210)
150 Opening BINARY mode data connection for test.txt (21 bytes).
226 File send OK.
21 bytes received in 0.0108 secs (1.9 Kbytes/sec)
更多精彩
赞助商链接