
위에 일부 사용자를 나열했습니다 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) 구성 파일을 사용하는 것이 더 나을 수도 있습니다.
답변2
# Lock all the users in home directory, ***** really important *****
DefaultRoot ~
MaxLoginAttempts 5
#VALID LOGINS
<Limit LOGIN>
AllowUser userftp
DenyALL
</Limit>
<Directory /var/www>
Umask 022 022
AllowOverwrite on
#<Limit STOR>
#AllowAll
#</Limit>
<Limit ALL>
Order Allow,Deny
AllowUser userftp
Deny ALL
</Limit>
</Directory>
더 읽어보세요http://www.red87.com/install-proftpd-in-ubuntu-server/