Installations- und Konfigurationsprozess:
Hier ist eine Zusammenfassung meiner Installation und Konfigurationsschritte:
Abhängigkeiten installieren:
Code: Select all
sudo yum install openssl-devel
cd /home/a/
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.8c.tar.gz
yum install gcc gcc-c++ autoconf automake
tar -xzf proftpd-1.3.8c.tar.gz
cd proftpd-1.3.8c
./configure --prefix=/usr/local/proftpd \
--sysconfdir=/etc/proftpd \
--enable-nls \
--enable-openssl \
--enable-shadow
make
make install
Code: Select all
cp contrib/dist/rpm/proftpd.init.d /etc/init.d/proftpd
chmod +x /etc/init.d/proftpd
chkconfig --add proftpd
chkconfig proftpd on
Ich habe die folgenden Änderungen vorgenommen:
Code: Select all
# From:
[ ${NETWORKING} = "no" ] && exit 1
# To:
[[ ${NETWORKING} = "no" ]] && exit 1
Code: Select all
# From:
[ -x /usr/sbin/proftpd ] || exit 5
# To:
[ -x /usr/local/proftpd/sbin/proftpd ] || exit 5
Code: Select all
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
Code: Select all
groupadd ftpgroup
useradd -g ftpgroup -d /var/ftp -s /sbin/nologin ftpuser
In /etc/proftpd/proftpd.conf habe ich die folgenden Änderungen vorgenommen:
Code: Select all
User ftpuser
Group ftpgroup
PidFile /run/proftpd/proftpd.pid
TransferLog /var/log/proftpd/transfer.log
SystemLog /var/log/proftpd/syslog.log
Code: Select all
nano ~/.bash_profile
# Add:
export PATH=$PATH:/usr/local/proftpd/sbin
source ~/.bash_profile
Code: Select all
sudo mkdir -p /var/log/proftpd/
sudo mkdir -p /run/proftpd/
sudo chown ftpuser:ftpgroup /run/proftpd/
sudo chmod 755 /run/proftpd/
Nachdem ich diese Schritte ausgeführt hatte, habe ich versucht, den ProFTPd-Dienst mit dem folgenden Befehl zu starten:
Code: Select all
service proftpd start
Code: Select all
vbnet
Copy code
Starting proftpd (via systemctl): Warning: proftpd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for proftpd.service failed because the control process exited with error code. See "systemctl status proftpd.service" and "journalctl -xe" for details.
[FAILED]
Code: Select all
systemctl status proftpd
Code: Select all
● proftpd.service - LSB: ProFTPd FTP Server
Loaded: loaded (/etc/rc.d/init.d/proftpd; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2025-01-03 06:39:09 EST; 14s ago
I also checked the logs with journalctl -xe and found the error:
Code: Select all
error writing PidFile '/run/proftpd/proftpd.pid': No such file or directory
Gesicherte Verzeichnisberechtigungen: Ich habe die erforderlichen Verzeichnisse erstellt und den Besitzer und die Berechtigungen geändert:
Code: Select all
sudo mkdir -p /run/proftpd/
sudo chown ftpuser:ftpgroup /run/proftpd/
sudo chmod 755 /run/proftpd/
In /home/a/proftpd-1.3.8c/contrib/dist/rpm/proftpd.service habe ich die ExecStart-Zeile aktualisiert, um sicherzustellen Es wird die richtige Binärdatei verwendet:
Code: Select all
ExecStart = /usr/local/proftpd/sbin/proftpd --nodaemon $PROFTPD_OPTIONS
ExecStartPre=/usr/local/proftpd/sbin/proftpd --configtest
Der Dienst startet auch nach diesen Änderungen immer noch nicht. Die Protokollfehlermeldung weist darauf hin, dass die PID-Datei in /run/proftpd/ immer noch nicht erstellt werden kann und die Protokolldatei selbst die Aufzeichnung der Aktivitäten stoppt.
Meine Fragen:
Könnte das sein? Hängt das Problem mit den Dateisystemberechtigungen oder dem Benutzer zusammen, unter dem ProFTPd ausgeführt wird?
Welche Schritte kann ich unternehmen, um das Problem bei der Erstellung der PID-Datei zu beheben?
Gibt es noch andere Konfigurationsänderungen, die ich möglicherweise übersehe? Verhinderung von ProFTPd Wird gestartet?
Vielen Dank für Ihre Hilfe! Ich verwende das Terminal mit dem Benutzernamen „a“, nicht „ftpuser“, und während ich ein Terminal erneut öffne, verschwindet der neu hinzugefügte Pfad in $PATH!
< stark>BEARBEITEN**####################################### ########**
ich habe verwendet
Code: Select all
echo 'export PATH=$PATH:/usr/local/proftpd/sbin' >> ~/.bashrc
source ~/.bashrc
Code: Select all
2025-01-03 07:06:17,300 vbox proftpd[19715] vbox: ProFTPD 1.3.8c (maint) (built Fri Jan 3 2025 06:22:03 EST) standalone mode STARTUP
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Failed binding to 0.0.0.0, port 21: Address already in use
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Check the ServerType directive to ensure you are configured correctly
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Check to see if inetd/xinetd, or another proftpd instance, is already using 0.0.0.0, port 21
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Unable to start proftpd; check logs for more details