[Linux] FTPサーバー vsftpd の設定(vsftpd.conf)

FTPサーバーソフト「vsftpd」の設定方法です。
viでsftpdの設定ファイルを開きます。
1 |
# vi /etc/vsftpd/vsftpd.conf |
anonymous FTPの変更
デフォルトだとanonymous FTPが有効になっており、匿名ユーザーでのFTP接続が可能になってしまっています。
「anonymous_enable=YES」を「anonymous_enable=NO」に変更します。
12行目付近:
1 2 3 |
# Allow anonymous FTP? (Beware - allowed by default if you comment this out). # anonymous_enable=YES anonymous_enable=NO |
ASCⅡモードの有効化
ASCⅡモードでのアップロードとダウンロードを有効にします。下記2ヶ所の「#」を外します。
83行目付近:
1 2 3 |
# ASCII mangling is a horrible feature of the protocol. ascii_upload_enable=YES ascii_download_enable=YES |
ホームディレクトリ設定
ホームディレクトリより上の階層にアクセスすることを禁止する場合は以下を設定します。以下3行の「#」を外します。
100行目付近:
1 2 3 |
chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd/chroot_list |
最初がドットのファイルを表示
デフォルトだと「.htaccess」のように「.」が先頭にくるファイルが表示されません。下記を記載して先頭がドットのファイルが表示されるようにします。
1 |
force_dot_files=YES |
設定が終わったらvsftpdを再起動します。
1 |
# systemctl start vsftpd.service |
関連記事
- [vsftpd] インストールとCentOSのfirewallの設定
- [CentOS] 特定のサービスの起動を確認・自動起動設定
- [Linux] CentOSでサービスの起動・停止・状態の確認を行う方法
- [Apache] エラー対処方法 Job for httpd.service failed because the control process exited with error code
- [CentOS] CentOS6.x KagoyaVPSの設定