vsftpd FTP server start / stop / restart / status check

vsftpd Explains how to start / stop / restart / check the status of the FTP server.

vsftpd FTP server status check

To check the status of the vsftpd FTP server, use the "status" of the systemctl command.

sudo systemctl status vsftpd
If it is running

If it is running, the following will be displayed.

● vsftpd.service-vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-05-19 12:55:57 JST; 18min ago
 Main PID: 8044 (vsftpd)
    Tasks: 1 (limit: 9479)
   CGroup: /system.slice/vsftpd.service
           mq8044 /usr/sbin/vsftpd /etc/vsftpd.conf
When stopped

If it is stopped, the following will be displayed.

● vsftpd.service-vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2020-05-19 13:15:39 JST; 5s ago
  Process: 8044 ExecStart = / usr / sbin / vsftpd /etc/vsftpd.conf (code = killed, signal = TERM)
 Main PID: 8044 (code = killed, signal = TERM)

May 19 12:55:57 development-batch systemd [1]: Starting vsftpd FTP server ...
May 19 12:55:57 development-batch systemd [1]: Started vsftpd FTP server.
May 19 13:15:39 development-batch systemd [1]: Stopping vsftpd FTP server ...
May 19 13:15:39 development-batch systemd [1]: Stopped vsftpd FTP server.

Start vsftpd FTP server

The vsftpd FTP server is started using the systemctl command "start". Run with root privileges using the sudo command.

sudo systemctl start vsftpd

Even if the boot is successful, the message that it was successful is not returned. Please check the status.

Stop vsftpd FTP server

To stop the vsftpd FTP server, use the "stop" systemctl command. Run with root privileges using the sudo command.

sudo systemctl stop vsftpd

If the outage is successful, no successful message will be returned. Please check the status.

Restart the vsftpd FTP server

vsftpd Use the systemctl command "restart" to restart the FTP server. Run with root privileges using the sudo command.

sudo systemctl restart vsftpd

restart simply executes the stop command and executes the start command. Normally, use the reload command as it will disconnect the processing from the HTTP client.

If the reboot is successful, you will not get a successful message. Please check the status.

vsftpd To see the start / stop log of the FTP server

Servers such as the vsftpd FTP server are centrally managed by a program called systemd.

The vsftpd FTP server start / stop log is output to the systemd log.

Use the journalctl command to see the systemd logs. Specify the unit "vsftpd" with the "-u" option. Please note that you will not be able to see the FTP server logs unless you run it with sudo. If you want to see only the last part of the log, combine the "-r" option.

sudo journalctl -r -u vsftpd

This is a sample log.

--Logs begin at Mon 2020-06-01 15:51:16 JST, end at Thu 2020-07-23 14:42:25 JST. -
Jul 22 13:24:34 shinshina-development-app-00000001 systemd [1]: Started vsftpd FTP server.
Jul 22 13:24:33 shinshina-development-app-00000001 systemd [1]: Starting vsftpd FTP server ...
--Reboot -
Jul 22 13:13:48 shinshina-development-app-00000001 systemd [1]: Stopped vsftpd FTP server.
Jul 22 13:13:47 shinshina-development-app-00000001 systemd [1]: Stopping vsftpd FTP server ...
Jun 22 23:17:45 shinshina-development-app-00000001 vsftpd [7261]: pam_unix (vsftpd: auth): authentication failure; logname = uid = 0 euid = 0 tty = ftp ruser = anonymous rhost =::ffff: 35.187 .98.101
Jun 22 23:17:45 shinshina-development-app-00000001 vsftpd [7261]: pam_unix (vsftpd: auth): check pass; user unknown
Jun 22 19:42:05 shinshina-development-app-00000001 vsftpd [122058]: pam_unix (vsftpd: auth): authentication failure; logname = uid = 0 euid = 0 tty = ftp ruser = admin rhost =::ffff: 80.184 .11.115
Jun 22 19:42:05 shinshina-development-app-00000001 vsftpd [122058]: pam_unix (vsftpd: auth): check pass; user unknown </pre>

<h3> vsftpd To see the systemd configuration file for the FTP server </h3>

vsftpd You can see the systemd configuration file for the FTP server under "systemctl status vsftpd".

Let's take a look at the configuration file with the <a href="https://en.linux.perlzemi.com/blog/20200113083613.html"> cat command</a>.

<pre>
cat /lib/systemd/system/vsftpd.service

You can check the command definitions for start, stop, and reload.

[Unit]
Description = vsftpd FTP server
After = network.target

[Service]
Type = simple
ExecStart = / usr / sbin / vsftpd /etc/vsftpd.conf
ExecReload = / bin / kill -HUP $MANPID
ExecStartPre =-/ bin / mkdir -p / var / run / vsftpd / empty

[Install]
WantedBy = multi-user.target

Other information on vsftpd FTP server

To install the vsftpd FTP server

Installing the vsftpd FTP server is described in the following article.

Installing vsftpd-FTP server

vsftpd FTP server configuration file

The vsftpd FTP server configuration file will be discussed in another article.

Associated Information