Ubuntu installation VSFTPD ftp detailed steps _ftp server

Source: Internet
Author: User
Tags anonymous mkdir

VSFTPD is an FTP server that follows the GPL protocol for UNIX systems, including Linux. It's safe and very fast.

This tutorial will show you how to build your own FTP server in a Linux system.

1. Install VSFTPD.

sudo apt-get install vsftpd

2. Replace the configuration file.

Opens the vsftpd.conf configuration file with a text editor, typically under the/etc directory.

[Sudo joe/etc/vsftpd.conf

You can make the following modifications:

Put Anonymous_enable=yes

Change into

Anonymous_enable=no

This will prevent users from accessing your FTP server anonymously, unless you have a very good reason to allow anonymous access. And in doing network security, I recommend that anonymous access not be allowed, especially if your FTP server is on the Internet.

Of course, after you set up to disallow anonymous access, you need to allow local users to log in and modify the following:

Put #local_enable=yes

Change into

Local_enable=yes

3. Add a "fake" shell script.

Edit the/etc/shells file and add a nonexistent shell name such as/bin/false. This fake shell will restrict access to the system by the FTP user.

sudo joe/etc/shells

#/etc/shells:valid Login Shells 
/bin/sh 
/bin/bash 
/bin/false 

/bin/false is a shell that we add that doesn't exist. Just like a special device/dev/null on a red Hat Linux system.

4. Create an FTP user account.

It is important to create a strict FTP user account on a nonexistent shell on a Linux system. In this way, if for any reason someone can successfully leave the FTP chroot environment, he will not be able to perform any user tasks because the shell does not exist. First, create a new user.
This must be separated from the normal user account without restricted access because of the way the chroot environment works. Chroot is getting it from the user's point of view, and it seems that you have protected them at the top of the filesystem.

Use the following command to create a user in the/etc/passwd file, which you must perform each time you add a new user that allows access to your FTP server.

sudo mkdir-p/home/ftp/ftpuser 
sudo useradd ftpuser-d/home/ftp/ftpuser/-s/bin/false 

-The mkdir command will create the Ftp/ftpuser directory under the/home directory to handle all FTP users.
-The Useradd command will add a new user named Ftpuser on your Linux server.
-Finally, the passwd command sets the user's ftpuser password.
Once you have completed these, restart the VSFTPD service with the following command:

SUDO/ETC/INIT.D/VSFTPD restart

5. Overwrite the configuration items specified in the user's manual (optional) on a per-user basis.

If you want to change the behavior of the FTP server on a per-user basis, you apply to know that VSFTPD has a powerful option that allows you to do so.
If you set up User_config_dir for/etc/vsftpd_user_conf and log in as a "Chris" user, then VSFTPD will be in/etc/vsftpd_user_conf/chris during the duration of the session File to apply these settings, the format of the file is detailed in the user manual!

Note that not all settings take effect for each user, for example, many settings are only valid for previous user sessions that have been started. These will not affect the setting of any behavior for each user, including Listen_address, Banner_file, Max_per_ip, Max_clients, Xferlog_file, and so on.

Thank you for reading, I hope to help you, thank you for your support for this site!

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.