Ubuntu 24.04 FTPサーバ Vsftpd Over SSL/TLSの設定方法

環境
Ubuntu 24.04

1.自己署名の証明書を作成します。
Let’s Encrypt 等の信頼された正規の証明書を使用する場合は当作業は不要です。

# cd /etc/ssl/private
root@www:/etc/ssl/private# openssl req -x509 -nodes -newkey rsa:3072 -keyout vsftpd.pem -out vsftpd.pem -days 3650

-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:JP                            # 国コード
State or Province Name (full name) [Some-State]:Tokyo       # 地域(県)
Locality Name (eg, city) []:Tokyo                           # 都市
Organization Name (eg, company) [Internet Widgits Pty Ltd]:GTS  # 組織名
Organizational Unit Name (eg, section) []:arkgame          # 組織の部門名
Common Name (e.g. server FQDN or YOUR name) []:www.arkgame.com    # サーバーの FQDN
Email Address []:root@arkgame.com                                 # 管理者アドレス

権限を付与します
root@www:/etc/ssl/private# chmod 600 vsftpd.pem

2.Vsftpd の設定です。
# vi /etc/vsftpd.conf

# 149行目 : 以下のように変更
rsa_cert_file=/etc/ssl/private/vsftpd.pem
rsa_private_key_file=/etc/ssl/private/vsftpd.pem
ssl_enable=YES
ssl_ciphers=HIGH
force_local_data_ssl=YES
force_local_logins_ssl=YES

3.再起動
# systemctl restart vsftpd

IT

Posted by arkgame