【Linux】FTPファイルサーバー

1. FTP の概要

FTP (ファイル転送プロトコル) は、TCP/IP プロトコル スイートのプロトコルの 1 つです。その主な機能は、サーバーとクライアント間でファイルを転送することです。FTPは2台のコンピュータ間のコピーを実現するもので、相手のコンピュータから自分のコンピュータにファイルをコピーすることを「ダウンロード」ファイルといいます。自分のコンピュータからリモート コンピュータにファイルをコピーすることを、ファイルの「アップロード」と呼びます。この古代のプロトコルはクリアコード送信を使用しており、過去にかなりの数のセキュリティ危機を引き起こした歴史があります。FTPプロトコルをより安全に利用するために、より安全ではあるが機能が少ないソフトウェアvsftpd(very secure File transfer protocol)を中心に紹介します。FTP は C/S タイプのソフトウェアであり、FTP リスニングの TCP ポート番号は 21、データ ポートは 20 です。

2. 応用シナリオ

ダウンロード サーバー: 外部ダウンロード サービスを提供します。
ファイル サーバー: アップロードおよびダウンロード サービスを提供します。

3. FTP 権限

FTP サーバーの機能は、単にファイルを転送および管理するだけでなく、サーバー ソフトウェアの設定アーキテクチャに応じていくつかの主要な機能も提供できます。:
さまざまなレベルのユーザー ID: ユーザー、ゲスト、匿名
デフォルトでは、FTP サーバーはユーザーのログイン ステータスに基づいて、次の 3 つの異なる ID に分割されます。

(1) ローカル ユーザー: システム内の実際のユーザー
(2) ゲスト、ゲスト;
(3) 匿名ログイン、匿名

これら 3 つの ID を持つユーザーは、システム上でまったく異なる権限を持っています。たとえば、エンティティ ユーザーはシステム上で比較的完全な権限を持っているため、より多くのアクションを実行できます。匿名ログインに関しては、おそらくリソースをダウンロードする機能のみを提供しており、匿名ユーザーがあまりにも多くのホスト リソースを使用することは許可されていません。もちろん、この3種類のキャラクターは権限の違いにより使用できる【オンラインコマンド】も当然異なります!

4. FTP 動作モード

FTP は 2 つのモードをサポートしています。1 つは標準 (つまり、PORT モード、アクティブ モード) と呼ばれ、もう 1 つはパッシブ (つまり、PASV、パッシブ モード) と呼ばれます。標準モードの FTP クライアントは、FTP サーバーに PORT コマンドを送信します。パッシブ モードの FTP クライアントは PASV コマンドを FTP サーバーに送信します。

ここでは、これら 2 つの方法の動作原理を紹介します。

ポート モード FTP クライアントは、まず FTP サーバーの TCP 21 ポートとの接続を確立し、このチャネルを通じてコマンドを送信します。クライアントがデータを受信する必要がある場合は、このチャネルで PORT コマンドを送信します。PORT コマンドには、クライアントがデータを受信するために使用するポートが含まれています。データを送信するとき、サーバーは独自の TCP 20 ポートを介してクライアントの指定されたポートに接続してデータを送信します。FTP サーバーは、データを転送するためにクライアントとの新しい接続を確立する必要があります。

パッシブ モードは、制御チャネルを確立するときは標準モードに似ていますが、接続を確立した後、Port コマンドではなく Pasv コマンドを送信します。Pasv コマンドを受信すると、FTP サーバーはランダムにハイエンド ポート (ポート番号は 1024 より大きい) を開き、このポートでデータを送信する要求をクライアントに通知します。クライアントは FTP サーバーのこのポートに接続し、その後、FTP サーバーはこのポートを介してデータを送信します。転送すると、FTP サーバーはクライアントとの新しい接続を確立する必要がなくなります。

多くのファイアウォールは、セットアップ時に外部から開始された接続を受け入れることができないため、クライアントがファイアウォールを介して FTP サーバーのハイエンド ポートを開くことができないため、ファイアウォールの内側またはイントラネット上にある多くの FTP サーバーは PASV モードをサポートしていません。スレーブ サーバーの TCP 20 が内部ネットワーク上のクライアントとの新しい接続を確立できず、機能しなくなるため、インターネット上のクライアントは PORT モードで FTP サーバーにログインできません。

5. FTP のインストールと展開

この実験で使用したマシンは、IP アドレス 192.168.11.16/24 の centos8.0_x86_64 システムで、ファイアウォールと SELINUX をオフにします。

#vsftp安装
[root@localhost ~]# dnf -y install vsftpd ftp

#vsftp开机启动
[root@localhost ~]# systemctl enable vsftpd
Created symlink from /etc/systemd/system/multi-user.target.wants/vsftpd.service to 
/usr/lib/systemd/system/vsftpd.service.

#启动vsftp服务
[root@localhost ~]# systemctl start vsftpd

#验证启动
[root@localhost ~]# lsof -i :21
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
vsftpd  1951 root    4u  IPv6  32837      0t0  TCP *:ftp (LISTEN)

6. FTP設定ファイル

6.1) 関連文書

主な設定ファイル:/etc/vsftpd/vsftpd.conf

ダウンロードディレクトリ:/var/ftp/

FTP ログ:/var/log/xferlog

6.2) 主な設定ファイルの詳細説明

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#匿名用户访问,YES是允许,NO是拒绝
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# 本地用户登录,YES是允许,NO是拒绝.默认访问的是本地用户家目录,如果你开启了selinux
# 请设置开启布尔值ftp_home_dir为ON
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
#允许本地用户上传
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# 上传的权限是022,使用的是umask权限。对应的目录是755,文件是644
# if your users expect that (022 is used by most other ftpd's)
local_umask=022

#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
# 开启匿名用户上传功能,默认是拒绝的
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
# 开启匿名用户创建文件或文件夹权限
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
# 开启目录欢迎消息,一般对命令行登陆有效
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
# 开启上传和下载日志记录功能
xferlog_enable=YES
#
#使用标准模式
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
# 声明匿名用户上传文件的所有者
# 允许更改匿名用户上传文件的所有者
#chown_uploads=YES
#所有者为whoever
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
# 日志文件路径
#xferlog_file=/var/log/xferlog
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
# 日志文件采用标准格斯
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
# 会话超时时间
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
# 数据传输超时时间
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
# FTP子进程管理用户
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
# 是否允许客户端发起“async ABOR”请求,该操作是不安全的默认禁止。
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode. The vsftpd.conf(5) man page explains
# the behaviour when these options are disabled.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
# 该选项用于指定是否允许上传时以ASCII模式传输数据
#ascii_upload_enable=YES
#该选项用于指定是否允许下载时以ASCII模式传输数据
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
# FTP文本界面登陆欢迎词
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
# 是否开启拒绝的Email功能
#deny_email_enable=YES
# (default follows)
# 指定保存被拒接的Email地址的文件
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
# 是否开启对本地用户chroot的限制,YES为默认所有用户都不能切出家目录,NO代表默认用户都可以切出家目录
# 设置方法类似于:YES拒绝所有,允许个别    NO  允许所有拒绝个别
#chroot_local_user=YES
#开启特例列表
#chroot_list_enable=YES
# (default follows)
# 如果chroot_local_user的值是YES则该文件中的用户是可以切出家目录,如果是NO,该文件中的用户则不能切出家目录
# 一行一个用户。
#chroot_list_file=/etc/vsftpd/chroot_list

# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
# 是否开启ls 递归查询功能 ls -R
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
# 是否开启ftp独立模式在IPV4
listen=NO
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
# 是否开启ftp独立模式在ipv6
listen_ipv6=YES


#启用pam模块验证
pam_service_name=vsftpd
#是否开启userlist功能.

#是否启用用户列表功能
userlist_enable=YES

構成ファイルの分析を通じて、VSFTP は匿名アクセスを許可せず、ローカル ユーザーはダウンロードとアップロードを行うことができます。匿名ユーザーのログインを許可する場合は、anonymous_enable=YES を設定してサービスを再起動する必要があります。

設定ファイルの内容を変更することで、FTP の関連ログイン ステータスを設定できます。

7. FTPクライアントアクセス

FTP は C/S タイプのソフトウェアです。サーバーに接続するには FTP クライアントが必要です。一般的な FTP クライアントには次のものがあります:

ブラウザ: ブラウザに ftp://ip または ftp:// ドメイン名を入力すると、FTP にアクセスできます
内蔵クライアント: コマンド ラインで ftp コマンドを使用して、
サードパーティ クライアントに接続できます: FileZilla 8uftp グラフィカルソフトウェアまたはテキストインターフェイス lftp など。
3 つの方法のうち、テキストインターフェイスはさらに面倒で、マウスで移動することはできません。ですので、重点的に説明させていただきます。

7.1) テキストインターフェースログイン

文本界面匿名登陆
[root@localhost ~]# ftp 192.168.11.16
Connected to 192.168.11.16 (192.168.11.16).
220 (vsFTPd 3.0.3)
Name (192.168.11.16:root): ftp	#用户名可以是ftp也可以是anonymous
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,11,16,90,35).
150 Here comes the directory listing.
drwxr-xr-x    2 0        0               6 May 14  2019 pub
226 Directory send OK.
通过ls可以列出当前目录下有哪些内容 看到有一个目录叫pub
ftp> pwd
257 "/"   
通过pwd命令查看当前路径  注意这里显示的是FTP的根目录

ftp> bye
221 Goodbye.
退出使用bye命令

文本界面本地用户登录
[root@localhost ~]# ftp 192.168.11.16
Connected to 192.168.11.16 (192.168.11.16).
220 (vsFTPd 3.0.3)
Name (192.168.11.16:root): hello
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,11,16,130,240).
150 Here comes the directory listing.
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 下载
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 公共
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 图片
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 文档
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 桌面
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 模板
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 视频
drwxr-xr-x    2 1001     1001            6 Jan 15 08:56 音乐
226 Directory send OK.
ftp> pwd
257 "/home/hello" is the current directory

7.2) FTPクライアントの共通コマンド

最も一般的に使用されるコマンドは次のとおりです。

  • ls はリモート マシンの現在のディレクトリをリストします。
  • cd はリモート マシン上の作業ディレクトリを変更します
  • lcd はローカル マシン上の作業ディレクトリを変更します
  • ascii はファイル転送モードを ASCII モードに設定します
  • binary は、ファイル転送モードをバイナリ モードに設定します。
  • リモート FTP サイトへの接続を開く
  • close は現在の FTP セッションを終了します
  • ハッシュでは、データ バッファー内のデータが送信されるたびに # 記号が表示されます。
  • get (mget) は、指定されたファイルをリモート マシンからローカル マシンに転送します (接頭辞 +m はバッチ操作です)。
  • put (mput) は、指定されたファイルをローカル マシンからリモート マシンに転送します。
  • delete(mdelete) ファイルを削除します

help コマンドを入力して、使用可能なすべてのコマンドを表示します

ftp> help
Commands may be abbreviated.  Commands are:

!                debug         mdir           sendport     site
$                dir           mget           put          size
account          disconnect    mkdir          pwd          status
append           exit          mls            quit         struct
ascii            form          mode           quote        system
bell             get           modtime        recv         sunique
binary           glob          mput           reget        tenex
bye              hash          newer          rstatus      tick
case             help          nmap           rhelp        trace
cd               idle          nlist          rename       type
cdup             image         ntrans         reset        user
chmod            lcd           open           restart      umask
close            ls            prompt         rmdir        verbose
cr               macdef        passive        runique        ?
delete           mdelete       proxy          send

!+linux コマンドはシステム コマンドを実行します

#!ls /opt  显示linux系统中/opt目录下的内容
ftp> !ls /opt
dhcp  dns  rh

Linuxシステムのlcdカレントディレクトリ

#lcd /root  将linux系统中的当前目录切换到/root下
ftp> lcd /root
Local directory now /root

put アップロード コマンド、mput バッチ アップロード コマンド

#上传initial-setup-ks.cfg文件到hello家目录下
ftp> put initial-setup-ks.cfg 
local: initial-setup-ks.cfg remote: initial-setup-ks.cfg
227 Entering Passive Mode (192,168,11,16,96,132).
150 Ok to send data.
226 Transfer complete.
1803 bytes sent in 0.00135 secs (1333.58 Kbytes/sec)
#可以看到上传成功了
#验证一下上传结果
ftp> ls
227 Entering Passive Mode (192,168,11,16,173,142).
150 Here comes the directory listing.
-rw-r--r--    1 1000     1000         1803 Feb 26 07:01 initial-setup-ks.cfg
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐
226 Directory send OK.

#切换linux当前目录到/tmp
ftp> lcd /tmp
Local directory now /tmp

get ダウンロード コマンド、mget バッチ ダウンロード

下载initial-setup-ks.cfg到linux系统当前目录/tmp
ftp> get initial-setup-ks.cfg
local: initial-setup-ks.cfg remote: initial-setup-ks.cfg
227 Entering Passive Mode (192,168,11,16,229,134).
150 Opening BINARY mode data connection for initial-setup-ks.cfg (1803 bytes).
226 Transfer complete.
1803 bytes received in 2.9e-05 secs (62172.41 Kbytes/sec)

#列出linux目录/tmp的内容,看到了下载的文件initial-setup-ks.cfg
ftp> !ls /tmp/
dhcp                                          tracker-extract-files.0
initial-setup-ks.cfg                                  VMwareDnD
systemd-private-8e7a99ea89c14ab396d66116970fe04d-chronyd.service-sghHHs       vmware-root
systemd-private-8e7a99ea89c14ab396d66116970fe04d-colord.service-wK7h08      yum_save_tx.2019-02-20.16-10.Z6uXqR.yumtx
systemd-private-8e7a99ea89c14ab396d66116970fe04d-cups.service-cokBro          yum_save_tx.2019-02-21.09-03.08zIbU.yumtx
systemd-private-8e7a99ea89c14ab396d66116970fe04d-rtkit-daemon.service-6wt1S0  yum_save_tx.2019-02-22.11-10.prawAT.yumtx

close を使用して切断することができ、接続が切断された後、再度接続したい場合は、open コマンドを使用するだけです。

ftp> close
221 Goodbye.
ftp> ls
Not connected.

ftp> open 192.168.11.16
Connected to 192.168.11.16 (192.168.11.16).
220 (vsFTPd 3.0.2)
Name (192.168.11.16:root): hello
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,11,16,192,88).
150 Here comes the directory listing.
-rw-r--r--    1 1000     1000         1803 Feb 26 07:01 initial-setup-ks.cfg
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐
226 Directory send OK.

delete コマンドは自分のファイルを削除できます

#删除initial-setup-ks.cfg文件
ftp> delete initial-setup-ks.cfg
250 Delete operation successful.
ftp> ls
227 Entering Passive Mode (192,168,11,16,168,142).
150 Here comes the directory listing.
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 下载
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 公共
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 图片
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 文档
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 桌面
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 模板
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 视频
drwxr-xr-x    2 1000     1000            6 Jan 11 01:37 音乐
226 Directory send OK.

8. 仮想ユーザーに基づいてセキュア FTP を構成する

FTP では、匿名ユーザーも実名ユーザーもシステム内では実際のユーザーであり、多かれ少なかれセキュリティ上のリスクがあります。このリスクを回避するために、開発者は仮想ユーザーの概念を FTP に追加しました。仮想ユーザーはでは、この仮想ユーザーをどのように実装すればよいでしょうか?

8.1) 設定ファイルの変更

[root@fixpng pam.d]# egrep -v "^#" /etc/vsftpd/vsftpd.conf 
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
listen=NO
listen_ipv6=YES


#虚拟用户配置选项
#pam登陆验证
pam_service_name=vftp
#允许虚拟用户功能
guest_enable=YES
#虚拟用户映射到本地用户hello
guest_username=hello
#这里我通过指令改变了默认设置,允许虚拟用户写
allow_writeable_chroot=YES 

#本地用户的根目录
#这里是定义虚拟用户主目录,用户和组必须指定为宿主用户hello
local_root=/home/hello


#允许虚拟用户和本地用户权限一致
virtual_use_local_privs=YES

#如果虚拟用户和本地用户权限不同,可以通过以下的指令来设置指令,配置文件和登陆名同步即可。
#user_config_dir=/etc/vsftpd/vconf.d/

8.2) 仮想ユーザーアカウントのパスワードファイルの生成

奇数行はアカウント、偶数行はパスワードです

[root@fixpng ~]# cat /etc/vsftpd/vuser
vuser01
123456
vuser02
123456

使用db_load转成db格式
[root@fixpng ~]# db_load -T -t hash -f /etc/vsftpd/vuser /etc/vsftpd/vuser.db
要求权限是600
[root@fixpng ~]# chmod 600 /etc/vsftpd/vuser.db

8.3) pam 認証を設定します。順序に注意してください。

[root@fixpng ~]# cat /etc/pam.d/vftp 
#虚拟用户登录
auth       sufficient     /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser
account    sufficient     /lib64/security/pam_userdb.so db=/etc/vsftpd/vuser
#本地登陆
session    optional     pam_keyinit.so    force revoke
auth       required    pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
auth       required    pam_shells.so
auth       include    password-auth
account    include    password-auth
session    required     pam_loginuid.so
session    include    password-auth

8.3) サービスを再起動して有効にします

[root@fixpng ~]# systemctl restart vsftpd
[root@fixpng ~]# cat /etc/vsftpd/chroot_list 
vuser01
vuser02

8.4) ログインの確認

[root@fixpng ~]# ftp 192.168.11.16
Connected to 192.168.11.16 (192.168.11.16).
220 Welcome to ayitula FTP service.
Name (192.168.11.16:root): vuser01
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,11,16,82,91).
150 Here comes the directory listing.
226 Transfer done (but failed to open directory).

無事着陸しました

おすすめ

転載: blog.csdn.net/qq_45277554/article/details/131452806