![FTP 액세스를 /var/www/로 제한하고 다른 디렉터리는 허용하지 않음](https://linux55.com/image/37717/FTP%20%EC%95%A1%EC%84%B8%EC%8A%A4%EB%A5%BC%20%2Fvar%2Fwww%2F%EB%A1%9C%20%EC%A0%9C%ED%95%9C%ED%95%98%EA%B3%A0%20%EB%8B%A4%EB%A5%B8%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EB%8A%94%20%ED%97%88%EC%9A%A9%ED%95%98%EC%A7%80%20%EC%95%8A%EC%9D%8C.png)
위에 일부 사용자를 나열했습니다 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/