This is the process of checking the "pure-ftpd" service on cpanel servers and restarting it accordingly.
Checking Service Status
First check the services status to ensure it is running.
root@server [~]# /etc/init.d/pure-ftpd statuspure-ftpd (pid 934) is running...+------+---------+-------+------+-------------------------------------------+| PID | Login |For/Spd| What | File/IP |+------+---------+-------+------+-------------------------------------------+
Here we can also see that it has the PID of 934, which we can additionally verify to ensure that it is not simply a stale PID:
root@server [~]# ps -clf 934
F S UID PID PPID CLS PRI ADDR SZ WCHAN STIME TTY TIME CMD
5 S root 934 1 TS 19 - 9571 poll_s Feb07 ? 0:29 pure-ftpd (SERVER)
Checking That Service Is Listening
The FTP service listens on port 21. We can use fuser to check if it listening on the server.
Checking for Port Listening
root@server [~]# fuser 21/tcp
or
root@server [~]# lsof -i :21
Checking External Accessibility
While the port may be listening on the server, we will want to additionally check if we are able to connect to it.Successful External Connection:
user@workstation [~]$ ftp server.example.com Connected to server.example.com.220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------220-You are user number 3 of 150 allowed.220-Local time is now 22:14. Server port: 21.220-IPv6 connections are also welcome on this server.220 You will be disconnected after 15 minutes of inactivity.Name (server.example.com:user):
If we find that the service is listening, but not accessible externally then restart the firewall accordingly.
Resolution
Restarting FTP
To restart the service use the following:Restarting the service:
root@server [~]# /etc/init.d/pure-ftpd restart
Stopping pure-config.pl:Stopping pure-authd: 1 process (pure-authd) sent signal 9
Starting pure-config.pl: Running: /usr/sbin/pure-ftpd -O clf:/var/log/xferlog --daemonize -A -c50 -B -C8 -D -E -fftp -H -I15 -lextauth:/var/run/ftpd.sock -L10000:8 -m4 -s -S21 -U133:022 -u100 -i -Oxferlog:/usr/local/apache/domlogs/ftpxferlog -k99 -Z -Y1 -JHIGH:MEDIUM:+TLSv1:!SSLv2:+SSLv3 [ OK ]
Starting pure-authd:
Note: If you are have anyother ftp service like vsftp or proftp you need to adjust restart command accordingly.
No comments:
Post a Comment