vsftp anonymous access settings

This paper is automatically released through MetaWeblog, and update the original link: https://extendswind.top/posts/technical/vsftpd_configuration

vsftpd (very secure ftpd), which rights management software in what is too safe point, a little problem can not access the details of the problem will appear. Just want to stand a LAN ftp file transfer, some of the small details in the blog and behind the design is not mentioned, stepped on a little pit, recording some simple anonymous ftp access scheme.

The main steps

1. Package Manager installation vsftpd. (Apt, yum, pacman, etc.)

2. modify the configuration file /etc/vsftpd.conf

anonymous_enable=YES  # 允许匿名访问
write_enable=YES  # 允许写文件
anon_upload_enable=YES  # 允许匿名用户上传文件
anon_mkdir_write_enable=YES  # 允许匿名用户创建目录和写权限
anon_other_write_enable=YES  # 允许匿名用户删除、重命名等其它权限  这个在配置文件里默认找不到

3. Create an anonymous user and folder access

By local_enableoptions allow ftp access through the local user, after logging accesses user's home directory. When anonymous user access, vsftpd will user named ftp as the user is logged into the ftp user's home directory.

Note that, taking into account security issues, ftp anonymous user's home directory must be read-only , if you want to upload files, you need to have write access to create a new folder in your home directory.

Usually choose /var/ftpa folder to store files instead of the default user /home, so you can modify the user's home directory location (usually in / var / ftp), also can be used without modification. Again, pay attention to ftp user's home directory permissions must be read-only .

sudo mkdir /var/ftp  # 新建用户文件夹
sudo useradd -d /var/ftp ftp  # 新建用户,并指定用户home目录 
# 如果ftp用户已经存在,在/etc/passwd文件里改用户目录为/var/ftp

sudo mkdir /var/ftp/pub  # 新建一个用于写数据的文件夹
sudo chmod 777 /var/ftp/pub   # 修改文件夹权限

4. Start Services

systemctl start vsftpd

other

If you use a firewall and SELinux rules need to be added by the response.

Testing can be directly accessed by the browser ftp://ip_address, under linux can use FileZilla.

Guess you like

Origin www.cnblogs.com/fly2wind/p/11939221.html