在linux 的ipv6的情况下进行ftp时,碰到unknown host 问题
1、[a4_csbdc@bdc8165 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
在红帽Red Hat Enterprise Linux Server release 5.5 (Tikanga) 下FTP
[a4_csbdc@bdc8165 ~]$ rpm -qa |grep ftp
ftp-0.17-37.el5
lftp-3.7.11-4.el5
tftp-server-0.49-2
vsftpd-2.0.5-24.el5
[a4_csbdc@bdc8165 ~]$ ftp [2001:202:32:0:250::XXXX:XXXX:57c0]
ftp: [2001:202:32:0:250:XXXX:XXXX:57c0]: unknown host
[a4_csbdc@bdc8165 ~]$ lftp bdcuser:bdcuser\!35tt436w@[2001:202:32:0:250::XXXX:XXXX:57c0]:21 #改用lftp命令,则可以登录. 注意其中密码bdcuser\!35tt436w中的反斜杆是转义符,是转义!号用的。
lftp bdcfff@2001:202:32:0:250:XXXX:XXXX:57c0:~> ls
drwxrwxr-x 6 505 505 4096 Sep 20 11:50 BDC_FTP
-rw-r--r-- 1 505 505 212 Oct 23 11:52 SUMMARY_FILE_20181023211157.verf
-rw-r--r-- 1 505 505 150 Oct 24 11:45 SUMMARY_FILE_20181024210500.verf
-rw-r--r-- 1 505 505 103 Oct 25 11:45 SUMMARY_FILE_20181025210500.verf
2.换另一台机器
[csbdc@sv0379 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.0 (Santiago)
Kernel \r on an \m
[csbdc@sv0379 ~]$ rpm -qa |grep ftp
ftp-0.17-51.1.el6.x86_64
vsftpd-2.2.2-6.el6.x86_64
report-plugin-ftp-0.18-7.el6.x86_64
gvfs-obexftp-1.4.3-9.el6.x86_64
report-config-ftp-0.18-7.el6.x86_64
tftp-0.49-5.1.el6.x86_64
lftp-4.0.9-1.el6.x86_64
[csbdc@sv0379 ~]$ ftp 2001:202:32:0:250:XXXX:XXXX:57c0 #可以成功
Connected to 2001:202:32:0:250:XXXX:XXXX:57c0 (2001:202:32:0:250:XXXX:XXXX:57c0).
220 (vsFTPd 2.2.2)
Name (2001:202:32:0:250:XXXX:XXXX:57c0:csbdc): bdcuser
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Entering Extended Passive Mode (|||3000|).
150 Here comes the directory listing.
drwxrwxr-x 6 505 505 4096 Sep 20 11:50 BDC_FTP
-rw-r--r-- 1 505 505 212 Oct 23 11:52 SUMMARY_FILE_20181023211157.verf
-rw-r--r-- 1 505 505 150 Oct 24 11:45 SUMMARY_FILE_20181024210500.verf
-rw-r--r-- 1 505 505 103 Oct 25 11:45 SUMMARY_FILE_20181025210500.verf
226 Directory send OK.
3. 初步认为: 是linux自带的FTP客户端的版本问题,但没有找到相关的资料。
ftp-0.17-37 不支持IPV6 (Red Hat Enterprise Linux 6 版本以下)
ftp-0.17-51.1 可以支持IPV6 (对应Red Hat Enterprise Linux 6 版本以上)