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

How to start and shut down the server of vsFTPd

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to start and shut down the vsFTPd server. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

1. Startup and shutdown of vsFTPd server

It is extremely easy to start and shut down the vsFTPd server; we can directly transfer the server to run in the background; this is how almost all servers run.

1.1.General methods for starting and shutting down vsFTPd servers

To run the vsftpd command, use root permissions. If your current user is not root, you can use su to switch to root permissions. There are two ways to switch root permissions, one is su, the other is sudo;. Please refer to "Control of Super permissions in Linux system".

The operation of vsFTPd server

[root@localhost] # / usr/sbin/vsftpd &

[root@localhost] # / usr/local/sbin/vsftpd &

Whether the vsFTPd server is running

We can use pgrep vsftpd to see if vsftpd is running.

[root@localhost ~] # pgrep vsftpd

4248

It shows that the vsFTPd server is running, and you can test the connection through ftp commands, lftp tools, or gftp or other FTP clients

VsFTPd server shutdown:

We use pkill vsftpd to kill the vsftpd process, so we turn off vsFTPd, use psgrep vsftpd to view the process, if there is no process, prove that vsFTPd has been turned off; of course, we also need to use root permissions.

[root@localhost ~] # pkill vsftpd

[root@localhost ~] # pgrep vsftpd

1.2.Startup and shutdown of vsFTPd server in Fedora/Redhat/CentOS:

In Fedora/Redhat/CentOS, you can also use the following methods to start vsFTPd;, of course, you also need to use root permissions.

[root@localhost beinan] # / etc/init.d/vsftpd start

Start vsftpd for vsftpd: [OK]

Restart vsFTPd with the following command

[root@localhost beinan] # / etc/init.d/vsftpd restart

Close vsftpd: [OK]

Start vsftpd for vsftpd: [OK]

To turn off the vsFTPd server, you should use the following command

[root@localhost beinan] # / etc/init.d/vsftpd stop

Close vsftpd: [OK]

2. The relationship between vsFTPd server, firewall and SELINUX; (important)

I read on the forum that some brothers said that the vsFTPd server started normally, but could not access or the user could not upload files. I think it should be the firewall or SELINUX; maybe the FTPD server was blocked by the firewall or SELINUX security mechanism. So you have to let the firewall go through ftp, and of course you have to let SELINUX go through the ftp server.

In Fedora/Redhat/CentOS, you need to set up a firewall. You can turn it off or let ftp "pass" it in customization.

[root@localhost ~] # system-config-securitylevel-tui

Or run the following command to clear the firewall rules (generic)

[root@localhost beinan] # iptables-F

With regard to the explanation of the SELINUX server, either the veteran or the novice may have some trouble with SELINUX. It is recommended that you SELINUX; or let the vsFTPd server skip SELINUX startup; that is to say, the general method of starting and shutting down the vsFTPd server should be used; it is effective to start the vsFTPd server in this way in Fedora/Redhat/CentOS

Of course, you can also turn off SELINUX, in the / etc/selinux/config configuration file as follows

/ etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

# enforcing-SELinux security policy is enforced.

# permissive-SELinux prints warnings instead of enforcing.

# disabled-SELinux is fully disabled.

SELINUX=Disabled # this shuts down the SELINUX server, please restart the system

# SELINUXTYPE= type of policy in use. Possible values are:

# targeted-Only targeted network daemons are protected.

# strict-Full SELinux protection.

SELINUXTYPE=targeted

3 、 500 OOPS: vsftpd: refusing to run with writable anonymous root

If we have already started the vsFTPd server, the login test will show a prompt similar to the following

500 OOPS: vsftpd: refusing to run with writable anonymous root

This means that the permissions of the ftp user's home directory are incorrect and should be corrected.

[root@localhost ~] # more / etc/passwd | grep ftp

Ftp:x:1000:1000:FTP User:/var/ftp:/sbin/nologin

We found that the home directory of ftp users is in / var/ftp. This is because the permissions of / var/ftp are incorrect, and the permissions of this directory cannot be opened. It is because you have run chmod 777 / var/ftp. If you do not have the home directory of ftp users, of course you have to build one yourself.

The following FTP users' home directories are not completely open to all users, user groups and other user groups

[root@localhost ~] # ls-ld / var/ftp

Drwxrwxrwx 3 root root 4096 2005-03-23 / var/ftp

To correct this mistake, the following methods should be used.

[root@localhost ~] # chown root:root / var/ftp

[root@localhost ~] # chmod 755 / var/ftp

Some brothers may say, what about the readability, downloading and uploading of anonymous users? This is also simple, create another directory under / var/ftp, permission is 777 on the line, and then change the vsftpd.conf to OK; it is not difficult

For security reasons, vsFTPd is not allowed to allow the permissions of ftp users' home directories to be completely unlimited. You can read the vsFTPd documentation to understand it; otherwise, it cannot be called the most secure FTP server, right?

4. Description of vsFTPd configuration file

Vsftpd.conf is the configuration file of the vsFTPd server. This file is usually / etc/vsftpd.conf or / etc/vsftpd/vsftpd.conf, depending on the system.

The vsftpd.conf configuration file is the global control file of the vsFTPd server. In this configuration file, each line should be counted as a rule; the server with the # sign in front of it will not explain it, which is similar to the apache configuration file; the content followed by # is generally illustrative, or the option to turn off some features.

Vsftpd.conf this configuration file does not include all the functions you want to achieve, we have to solve some functions ourselves, we should learn to check vsFTPd documents and FAQ, etc., although it is in English, it is relatively simple; we should get used to reading foreign language documents, why? Because Linux is originally a foreigner, heavyweight software is all foreigners. Oh, brother, don't complain, who made us fall behind?

Note: after modifying the configuration file, the vsFTPd server must be restarted to take effect. Remember ~ ~

This is the end of the article on "how to start and shut down the server of vsFTPd". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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