FTPアクセスを/var/www/に制限し、他のディレクトリは許可しません

FTPアクセスを/var/www/に制限し、他のディレクトリは許可しません

上記の一部のユーザーを一覧表示しましたvsftpd.chroot_list。私は彼らが次にしかアクセスできないことを望みます/var/www/いいえ別のディレクトリ。私はvsftpd.confファイルに必要な変更を加えたと思います。ただし、これらのユーザーは他のディレクトリにもアクセスできます。

私の/etc/vsftpd.confファイルには次のエントリがあります。

#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/private/vsftpd.pem

##########New Lines#######
user_config_dir=/etc/vsftpd/users
passwd_chroot_enable=YES

ベストアンサー1

FTPサーバーとして機能するため、vsftpd仮想ユーザーを簡単に設定してそのディレクトリにロックできます。この記事

vsftpd優れていますが、proftpdより単純な(IMO)設定ファイルを使用する方が良いかもしれません。

おすすめ記事