Ubuntu 18.04
Sponsored Link

FTPサーバー : ProFTPD Over SSL/TLS2018/05/09

 
ProFTPD を SSL/TLS で利用できるように設定します。
[1] 自己署名の証明書を作成します。Let's Encrypt 等の信頼された正規の証明書を使用する場合は当作業は不要です。
root@www:~#
cd /etc/ssl/private

root@www:/etc/ssl/private#
openssl req -x509 -nodes -newkey rsa:2048 -keyout proftpd.pem -out proftpd.pem -days 365

Generating a 2048 bit RSA private key
....................................+++
................................+++
writing new private key to 'proftpd.pem'
-----
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]:Hiroshima       # 地域(県)
Locality Name (eg, city) []:Hiroshima  # 都市
Organization Name (eg, company) [Internet Widgits Pty Ltd]:GTS  # 組織名
Organizational Unit Name (eg, section) []:Server World          # 組織の部門名
Common Name (e.g. server FQDN or YOUR name) []:www.srv.world    # サーバーのFQDN
Email Address []:root@srv.world        # 管理者アドレス

root@www:/etc/ssl/private#
chmod 600 proftpd.pem

[2] ProFTPD の設定です。
root@www:~#
vi /etc/proftpd/proftpd.conf
# 140行目:コメント解除

Include /etc/proftpd/tls.conf
root@www:~#
vi /etc/proftpd/tls.conf
# 10-12行目:コメント解除し変更

TLSEngine               on
TLSLog                  /var/log/proftpd/tls.log
TLSProtocol             TLSv1.2

# 27-28行目:コメント解除して変更

TLSRSACertificateFile      
/etc/ssl/private/proftpd.pem

TLSRSACertificateKeyFile  
/etc/ssl/private/proftpd.pem
root@www:~#
systemctl restart proftpd

FTPクライアント : Ubuntu
 
FTPクライアントの設定です。
[3] FTP クライアントインストール済みとして、Ubuntu クライアントの場合、以下のように設定して FTPS に接続します。 接続後は通常通りの操作でファイル転送可能です。
ubuntu@client:~$
vi ~/.lftprc
# 新規作成

set ftp:ssl-auth TLS
set ftp:ssl-force true
set ftp:ssl-protect-list yes
set ftp:ssl-protect-data yes
set ftp:ssl-protect-fxp yes
set ssl:verify-certificate no
bionic@client:~$
lftp -u ubuntu www.srv.world

Password:
lftp ubuntu@www.srv.world:~>
FTPクライアント : Windows
[4] Windows にインストールした FileZilla での FTPS 接続の設定です。
[ファイル] - [サイトマネージャ] を開きます。
[5] 以下のようにサーバーに接続する情報を入力して接続します。[暗号化] には [明示的な FTP over TLS が必要] を選択します。
[6] 接続ユーザーのパスワードを入力します。
[7] 自己署名の証明書の場合、以下のような警告が表示されますが、問題ないので [OK] ボタンをクリックして先へ進めます。
[8] 接続できました。
関連コンテンツ