Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration steps of vsftpd under linux

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the "installation and configuration steps of vsftpd under linux". In daily operation, I believe many people have doubts about the installation and configuration steps of vsftpd under linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "installation and configuration steps of vsftpd under linux". Next, please follow the editor to study!

Step 1: download vsftpd's RPM package

You can get the latest vsftpd RPM package Redhat's rpm collection or rpmfind.net from the following two places. For your convenience, you can also use wget to download vsftpd's rpm package from this site to your local computer.

The code is as follows:

Wget http://www.vsftpdrocks.org/vsftpd-1.1.3-8.i386.rpm

Once you have vsftpd's RPM package, you can install it

Rpm-Uvh vsftpd-1.1.3-8.i386.rpm

That's all。 Vsftpd is now officially installed.

Step 2: start and test in "standalone" mode

The code is as follows:

Vi / etc/vsftpd/vsftpd.conf

Add the following line, or check the file to make sure the following line exists:

The code is as follows:

Listen=YES

Save and exit.

Now let's start vsftpd...

The code is as follows:

/ usr/sbin/vsftpd &

Now use the ftp command to your server. You can see the conversation message after successful login as follows:

The code is as follows:

[root@somehost] ftp localhost

Connected to localhost.localdomain.

220 (vsFTPd 1.2.1)

Name (localhost:admin): bobsmith (obviously, you have to use valid users on your server)

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

Ftp > ls

150 Here comes the directory listing.

-rw-r--r-- 1 1001 1001 25372 Jan 17 18:50 somefile.tar.gz

Drwx- 2 1001 1001 512 Jan 16 19:16 index.htm

226 Directory send OK.

Ftp > quit

221 Goodbye.

[root@somehost]

If you are ready, you can see a return message similar to the above! If you want your FTP server to run on inetd or xinetd, you need to continue with the following tests. I personally recommend running the FTP server on inetd or xinetd.

Step 3: configure for inetd/xinetd operation

To configure vsftpd in inetd or xinetd, do the following:

First, edit / etc/vsftpd.conf and tell it that vsftpd is not running in "standalone" mode:

The code is as follows:

Vi / etc/vsftpd/vsftpd.conf

Confirm that the following line exists and set it to "NO":

The code is as follows:

Listen=NO

If you are running inetd, do the following:

The code is as follows:

Vi / etc/inetd.conf

If the file contains any "ftp" lines, comment or delete them and add the following line:

The code is as follows:

Ftp stream tcp nowait root / usr/local/sbin/vsftpd vsftpd

Save and exit.

Now restart inetd:

The code is as follows:

/ etc/rc.d/init.d/inetd restart

If your xinetd is running, do the following:

Redhat users:

The code is as follows:

Vi / etc/xinetd.d/vsftpd

# default: off

# description: The vsftpd FTP server serves FTP connections. It uses\

# normal, unencrypted usernames and passwords for authentication.

Service ftp

{

Disable = no

Socket_type = stream

Wait = no

User = root

Server = / usr/sbin/vsftpd

Nice = 10

}

Save and exit.

Now stop and restart xinetd...

The code is as follows:

/ etc/rc.d/init.d/xinetd restart

Now let's test the inetd/xinetd ftp server:

The code is as follows:

[root@somehost] ftp localhost

Connected to localhost.localdomain.

220 (vsFTPd 1.2.1)

Name (localhost:admin): bobsmith (obviously, you have to use valid users on your server)

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

Ftp > ls

150 Here comes the directory listing.

-rw-r--r-- 1 1001 1001 25372 Jan 17 18:50 somefile.tar.gz

Drwx- 2 1001 1001 512 Jan 16 19:16 index.htm

226 Directory send OK.

Ftp > quit

221 Goodbye.

[root@somehost]

If you are ready, you can see a return message similar to the above! Congratulations, your FTP server is running normally! In the next steps, we will adjust the configuration of vsftpd to have the best performance.

Step 4: vsftpd main configuration file

The main configuration of vsftpd should be: / etc/vsftpd.conf. This file will determine how to operate your vsftpd FTP server. You must look in vsftpd.conf to see if the following configuration options are included. I can't cover all the options, but the list lists important parts of the vsftpd configuration:

Anonymous_enable=NO/YES

This switch is used to turn on anonymous access to FTP. If this option is turned on, follow the method in step 3 to configure the anonymous service. If you are not sure what an anonymous FTP service is, it is best to set this option to "ON"

Local_enable=NO/YES

Enable or disable this option to enable local system users to FTP to your server. A typical FTP server sets it to "YES". I think there's only one option for "NO."

Write_enable=NO/YES

Enables or disables the write function of FTP. You must set it to "YES".

Local_umask=022 (or set up according to your needs)

The default umask for vsftpd is: 077. It determines the initial permissions that directories and files get when they are created

Xferlog_enable=YES

This option enables or disables uploading and downloading logging on the server.

Ftpd_banner=Welcome to blah FTP service

There is no way to define this option, but it can customize a more friendly greeting for your FTP server.

Chroot_list_enable=NO/YES

Chroot_list_file=/etc/vsftpd.chroot_list

This is a very important feature for turning on the chroot option. When chroot_list_enable is set to YES, vsftpd looks for the location on the next line specified by chroot_list_file. Any user listed in the "/ etc/vsftpd.chroot_list" file will automatically "chrooted" to their home directory. This will prohibit the user from entering any location except his or their user's home directory. Very suitable for shared FTP environment or general level of security and confidentiality.

Userlist_enable=NO/YES

Userlist_deny=NO/YES

The "userlist_enable" option is used to control one of the following two files: vsftpd.ftpusers and vsftpd.user_list. If this option is set to YES, the two files will list users and will allow access to the FTP service. In any case, when "userlist_deny=YES" is added, the two files will list users and will not be allowed to access the FTP service. This option is a very useful way to completely deny access to key system users through ftp. Users such as "root" or "apche" or "www". It is a very good use for the security of your FTP server.

Step 5: vsftpd.ftpusers, vsftpd.user_list configuration file

These two files are directly associated with the userlist_enable and userlist_deny options in the / etc/vsftpd.conf configuration file. When the userlist_enable option is set to YES, users in the two file lists will be allowed access to the FTP server. However, when the "userlist_deny=YES" option is added, users in the two file lists will not be allowed to access the FTP server. When the "userlist_deny" option is used, determining whether an account is rejected by the FTP service depends mainly on which of the two files it exists.

If a user exists in both "vsftpd.user_list" and "userlist_deny", when the user tries to connect to the FTP server, they will not be prompted for a password when they start to request a FTP connection and will be rejected.

If a user exists in both "vsftpd.user_list" and "userlist_deny", the user must change this password prompt after login.

Personally, I prefer to use "vsftpd.user_list" to build user lists (root, apache, www, nobody, etc.) If anyone has never seen the password prompt, he should initialize the connection to FTP.

Step 6: vsftpd.chroot_list profile

"vsfrtpd.chroot_list", when the "chroot_list_enable" option is enabled, the user list file created for FTP, whoever it is, must be "chrooted" to the main FTP directory. Those users cannot change paths to other user directories. This is a very good feature in a public FTP environment with strong confidentiality.

You can change your configuration file at any time and restart vsftpd after confirmation!

At this point, the study on the "vsftpd installation and configuration steps under linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report