#=============================
# ディレクトリ権限の設定
#-----------------------------
chmod 777 /var/ftp/pub
ls -ld /var/ftp/pub
#=============================
# /etc/vsftpd/vsftpd.conf
#-----------------------------
vi /etc/vsftpd/vsftpd.conf
# anonymous/IPv4有効、IPv6無効
★ anonymous_enable=YES
★ anon_upload_enable=YES
★ local_enable=NO
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
★ listen=YES
★ listen_ipv6=NO
pam_service_name=vsftpd
userlist_enable=YES
# アスキーモード/ダウンロードの許可
★ ascii_download_enable=YES
★ ascii_upload_enable=YES
★ download_enable=YES
dirlist_enable=YES
hide_ids=YES
force_dot_files=YES
# マスク値の設定変更
★ file_open_mode=0777
★ local_umask=000
# パッシブポート/ローカルタイム等
★ pasv_max_port=70010
★ pasv_min_port=70000
★ tcp_wrappers=NO
★ use_localtime=YES
★ virtual_use_local_privs=YES
# anonymous追加設定
★ anon_upload_enable=YES
★ anon_other_write_enable=YES
★ anon_mkdir_write_enable=YES
★ anon_umask=000
★ no_anon_password=YES
#=============================
# vsftpdサービス起動
#-----------------------------
systemctl restart vsftpd
#=============================
# 匿名FTP接続テスト
#-----------------------------
ftp -A 192.168.222.3
Connected to 192.168.222.3 (192.168.222.3).
220 (vsFTPd 3.0.3)
Name (192.168.222.3:root): anonymous
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxrwxrwx 2 ftp ftp 4096 Jan 07 2022 pub
226 Directory send OK.
ftp> pwd
257 "/" is the current directory
ftp> cd /pub
250 Directory successfully changed.
ftp> pwd
257 "/pub" is the current directory
ftp> put anon.txt
local: anon.txt remote: anon.txt
200 PORT command successful. Consider using PASV.
150 Ok to send data.
226 Transfer complete.
5 bytes sent in 0.000107 secs (46.73 Kbytes/sec)
ftp> exit
221 Goodbye.
#=============================
# パッシブモードの項目の注意
#-----------------------------
# スイッチとFTP接続する場合は無効化
pasv_address
pasv_enable
pasv_max_port
pasv_min_port
pasv_promiscuous
PR