Linux ftp anonymous user upload download login

Source: Internet
Author: User

FTP Server 192.168.62.2


First step: vsftpd configuration file changes

[[email protected]vsftpd]# Cat vsftpd.conf
# Example Config file/etc/vsftpd/vsftpd.conf
#
# The default compiled in Settings is fairly paranoid. This sample file
# loosens things up a bit, to make the FTP daemon more usable.
# vsftpd.conf.5 See the compiled in defaults.
#
# READ This:this Example file is a exhaustive list of vsftpd options.
# Please read the VSFTPD.CONF.5 manual page to get a full idea of vsftpd ' s
# capabilities.
#
# Allow anonymous FTP? (beware-allowed by default if you comment this out).
#anonymous_enable =no

Anonymous_enable=yes//Anonymous users can log on to the server

anon_umask=000//Other users can download files uploaded by anonymous users


# Uncomment this to allow local users to log in.
Local_enable=yes//Users above the server can log in
#
# Uncomment this to enable any form of FTP write command.
Write_enable=yes
#
# Default Umask for Local Users is 077. If you are wish to 022,
# If your users expect that (022 was used by the most other ftpd ' s)
local_umask=022
#
# Uncomment the anonymous FTP user to upload files. This only
# has a effect if the above global write enable is activated. Also, you'll
# obviously need to create a directory writable by the FTP user.
Anon_upload_enable=yes
#
# Uncomment this if you want the anonymous FTP user to being able to create
# New directories.
#anon_mkdir_write_enable =yes
#
# Activate Directory messages-messages given to remote users when they
# go into a certain directory.
Dirmessage_enable=yes
#
# The target log file can be Vsftpd_log_file or xferlog_file.
# This depends on setting Xferlog_std_format parameter
Xferlog_enable=yes
#
# Make sure port transfer connections originate from port (ftp-data).
Connect_from_port_20=yes
#
# If you want, you can arrange for uploaded anonymous files to being owned by
# a different user. note! Using "root" for uploaded files are not
# recommended!
#chown_uploads =yes
#chown_username =whoever
#
# The name of the log file when Xferlog_enable=yes and Xferlog_std_format=yes
# warning-changing This filename affects/etc/logrotate.d/vsftpd.log
Xferlog_file=/var/log/vsftpd.log
#
# switches between logging into Vsftpd_log_file and xferlog_file files.
# NO writes to Vsftpd_log_file, YES to Xferlog_file
Xferlog_std_format=yes
#
# You could change the default value of timing out an idle session.
idle_session_timeout=600
#
# The default value for timing out a data connection.
#data_connection_timeout =120
#
# It is recommended so define on your system a unique user which the
# FTP server can use as a totally isolated and unprivileged user.
#nopriv_user =ftpsecure
#
# Enable This and the server would recognise asynchronous ABOR requests. Not
# Recommended for security (the code is non-trivial). Not enabling it,
# However, may confuse older FTP clients.
#async_abor_enable =yes
#
# By default the server would pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to has the server actually do ASCII
# mangling on files while in ASCII mode.
# beware, some FTP servers, ASCII support allows a denial of service
# Attack (DoS) via the command "Size/big/file" in ASCII mode. Vsftpd
# predicted this attack and have always been safe, reporting the size of the
# RAW file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable =yes
#ascii_download_enable =yes
#
# fully customise the login banner string:
#ftpd_banner =welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# Useful for combatting certain DoS attacks.
#deny_email_enable =yes
# (default follows)
#banned_email_file =/etc/vsftpd/banned_emails
#
# Specify an explicit list of the Local users to Chroot () to their home
# directory. If Chroot_local_user is YES and then this list becomes a list of
# users to not Chroot ().
Chroot_local_user=yes
Chroot_list_enable=no
# (default follows)
#chroot_list_file =/etc/vsftpd/chroot_list

#chroot_list_file =/data
# You may activate the "-r" option to the builtin LS. This was disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# The presence of the "-r" option, so there was a strong case for enabling it.
#ls_recurse_enable =yes
#
# when "Listen" directive are enabled, VSFTPD runs in standalone mode and
# listens on IPV4 sockets. This directive cannot is used in conjunction
# with the Listen_ipv6 directive.
Listen=yes
#
# This directive enables listening on IPV6 sockets. To listen on IPV4 and IPV6
# sockets, you must run the copies of vsftpd with the configuration files.
# Make sure, which one of the listen options is commented!!
#listen_ipv6 =yes

Pam_service_name=vsftpd
#userlist_enable =yes
#userlist_deny =yes
#user_config_dir =/etc/vsftpd/user_config
#userlist_file =/etc/vsftpd/user_list
Local_root=/data
Anon_root=/data//Anonymous user Directory
Tcp_wrappers=yes
#userlist_deny =yes

Max_per_ip=0
Guest_enable=no
#guest_enable =yes
Local_max_rate=0
Max_clients=0

#This function is to enable passive mode
Pasv_enable=yes

Step Two: FTP User root permissions change

1. Delete the FTP user
[[email protected]/]# userdel-r FTP
There will be an error message, but it is normal to ignore it.

2, we will add this user, such as I want to account for the FTP home directory set in/VAR/FTP2, we can do the following
[[email protected]/]# adduser-d/data FTP

3, must change the/VAR/FTP2 this directory permissions.
[[email protected]/]# chmod og-w/data //This must have. The most important step!
[Email protected]/]# chown-r root.root/data

You do not need to restart Vsftp to access the changed directory.


Linux ftp anonymous user upload download login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.