# ftp - 用来登录远程ftp服务器

ftp指令可以用来登录远程ftp服务器。

# 适用范围

RedHat
RHEL
Ubuntu
CentOS
Debian
Deepin
SUSE
openSUSE
Fedora
Linux Mint
Alpine Linux
Arch Linux

# 语法

ftp  [选项]  [host]

# 选项

-A                 # 活动模式,对于不支持密码连接的服务器,可以用来传输文件
-P                 # 被动模式,允许在有防火墙的服务器中使用
-i                 # 关闭互动模式
-n                 # 不使用自动登录
-g                 # 关闭本地主机文件名称支持特殊字符的扩展性
-v                 # 显示详细过程
-d                 # 使能调试

# 举例

登录ftp服务器

[root@localhost ~]$ ftp 192.168.1.8            #登录
Connected to 192.168.1.8 (192.168.1.8).
220 (vsFTPd 2.2.2)
Name (192.168.1.8:root): ftp                   #用户名
331 Please specify the password.
Password:                                      #密码
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls                                        #查看内容
227 Entering Passive Mode (192,168,1,8,44,30).
150 Here comes the directory listing.
drwxr-xr-x    2 0        0            4096 Aug 14 06:38 pub
226 Directory send OK.
ftp>