In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
It is believed that many inexperienced people have no idea about how to configure ftp in Ubuntu. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Installation and configuration of ftp server
1. Installation of ftp server
If the ftp server has been configured before or the server configured later, the service cannot be started, then basically there is an error in the configuration, so you can uninstall it completely before installing it. If the problem is mostly due to the mirror source, replace the Ali source.
Sudo apt-get update
Sudo apt-get install vsftpd
Vsftpd-- version / / detects whether it is installed
2. Configuration of ftp server
Vim / etc/vsftpd.conf / / Edit configuration file
Modify the vsftpd.conf file as follows:
Listen=NO / / whether to enable listening to ipv4 and ipv6 data
Listen_ipv6=YES / / whether to enable listening to ipv6 data
# Allow anonymous FTP? (Disabled by default).
Anonymous_enable=NO / / whether to allow anonymous login, no password required
# Uncomment this to allow local users to log in.
Local_enable=YES / / whether to allow local users to log in
# Uncomment this to enable any form of FTP write command.
Write_enable=YES / / whether the lander is allowed to upload files
# Default umask for local users is 077. You may wish to change this to 022
# if your users expect that (022 is used by most other ftpd's)
Local_umask=022 / / set the permissions to be waived by default for local users
# Activate directory messages-messages given to remote users when they
# go into a certain directory.
Dirmessage_enable=YES / / directory messages, which can send directories to remotely logged-in users
#
# If enabled, vsftpd will display directory listings with the time
# in your local time zone. The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
The directory displayed by the use_localtime=YES / / server will change with local time
#
# Activate logging of uploads/downloads.
Xferlog_enable=YES / / enable logging of uploads and downloads
#
# MT4 usage tutorial http://www.gendan5.com/operation.html
# Make sure PORT transfer connections originate from port 20 (ftp-data).
Connect_from_port_20=YES / / confirm that the port number transmitted by the connection is 20
# You may override where the log file goes if you like. The default is shown
# below.
Location of xferlog_file=/var/log/vsftpd.log / / log files
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is / var/log/xferlog in this case.
Xferlog_std_format=YES / / log files are in standard format
# You may fully customise the login banner string:
Ftpd_banner=Welcome to FTP service. / / if you log in when using shell, you will send a welcome message
# You may specify an explicit list of local users to chroot () to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot ().
# (Warning! Chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
Chroot_local_user=YES / / whether to impose restrictions on local users
Chroot_list_enable=YES / / Open the restricted whitelist
# (default follows)
Chroot_list_file=/etc/vsftpd.chroot_list / / whitelist path. If there is no such file, you need to create it yourself.
# 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
Pam_service_name=ftp / / here the ubuntu system needs to be changed to ftp
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
Rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
Rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
Ssl_enable=NO
#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
Utf8_filesystem=YES / / codes are unified as utf8 codes, which can identify Chinese characters and prevent garbled codes.
3. Vftpd configuration is complete
Add set ftpuser user and access directory
1. Create ftp user groups and users
Sudo groupadd ftpusers / / create a ftpusers user group
Sudo useradd-m ftpuser_lxr// creates a user and automatically creates a home directory as / home/ftpuser_lxr
(the second way: mkdir / home/ftpuser_lxr / / first create a home directory sudo userad-d / home/ftpuser_lxr ftpuser_lxr / / bind this home directory)
Usermod-G ftpusers ftpuser_lxr / / add this new user to the ftpusers user group
Sudo passwd ftpuser_lxr / / change password
Mkdir / home/ftpuser_lxr/ftp / / add a folder with certain permissions for the user
Chmod 777-R / home/ftpuser_lxr/ftp / / create a new pub directory to store files and grant full permissions
Usermod-s / sbin/nologin username / / restricts the way users log in; restricts users' username login only through ftp, not directly to the server
two。 Add the user to the vsftpd.chroot_list whitelist
Mkdir / etc/vsftpd.chroot_list
Vim vsftpd.chroot_list
The contents of the file are as follows:
# whitelist
Ftpuser_lxr
3. Start and restart the service of vsftpd
Systemctl start vsftpd or service vsftpd start
Systemctl restart vsftpd or service vsftpd restart
test
Method 1: open the browser and enter: ftp://ip_addresss in the address bar
Method 2: use shell in ubuntu to enter: ftp ip_address
Method 3: enter ftp://ip_addresss in the address bar of the file manager in windows, which can upload and download files
Method 4:
Use cmd in windows to enter: ftp://ip_addresss / / to show that the connection is successful
After reading the above, have you mastered how to configure ftp in Ubuntu? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.