一 在windows上搭建服务器
http://www.xlightftpd.com/download.htm
使用英文版,使防止在ubuntu中登录中文版时,显示乱码
新建用户和用户对应的服务器目录
如下所示,默认只有读权限
全都勾选
勾选完毕后的效果
在目录中放一个文件,用于下载测试
文件内容是hello world
二 在ubuntu中连接
登录ftp服务器
lkmao@ubuntu:~$ ftp 192.168.31.248
Connected to 192.168.31.248.
220 Xlight FTP Server 3.9 ready...
Name (192.168.31.248:lkmao): lkmao
331 Password required for lkmao
Password:
230 Login OK
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
查询服务器中的文件
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for /bin/ls (171 bytes).
drw-rw-rw- 1 ftp ftp 0 May 11 19:58 .
drw-rw-rw- 1 ftp ftp 0 May 11 19:58 ..
-rw-rw-rw- 1 ftp ftp 11 May 11 20:12 hello.txt
226 Transfer complete (0.000 KB/s).
ftp>
下载服务器中的文件hello.txt到ubuntu本地目录
ftp> get hello.txt
local: hello.txt remote: hello.txt
200 PORT command successful
150 Opening BINARY mode data connection for hello.txt (11 bytes).
226 Transfer complete (0.000 KB/s).
11 bytes received in 0.01 secs (1.6683 kB/s)
ftp>
发送本地目录的文件到服务器
ftp> send test.txt
local: test.txt remote: test.txt
200 PORT command successful
150 Opening BINARY mode data connection for test.txt.
226 Transfer complete (0.000 KB/s).
13 bytes sent in 0.00 secs (35.4618 kB/s)
ftp>
服务器新增了文件
使用?可以看到其他的命令
ftp> ?
Commands may be abbreviated. Commands are:
! dir mdelete qc site
$ disconnect mdir sendport size
account exit mget put status
append form mkdir pwd struct
ascii get mls quit system
bell glob mode quote sunique
binary hash modtime recv tenex
bye help mput reget tick
case idle newer rstatus trace
cd image nmap rhelp type
cdup ipany nlist rename user
chmod ipv4 ntrans reset umask
close ipv6 open restart verbose
cr lcd prompt rmdir ?
delete ls passive runique
debug macdef proxy send
ftp>