Benutzer-Werkzeuge

Webseiten-Werkzeuge


howto:centos_proftpd

proftpd Installation


Autor: F4RR3LL|sven
E-Mail: sven.richter@nixhelp.de
Stand: 06.04.2008


In diesem Howto erkläre ich die Installation von proftpd unter CentOS 5.0

Die Installation

Der Start der Installation ist denkbar einfach

yum install proftpd


Proftpd wird nicht automatisch in den *Autostart* eingetragen.
Damit Proftpd zukünftig auch nach einem Reboot wieder mitgestartet wird folgendes ausführen

chkconfig –-level 235 proftpd on


Das wars auch schon proftpd ist installiert und rennt bereits auf dem System.
Mit den folgenden Befehlen könnt ihr nun euren FTP Server starten und stoppen.

/etc/init.d/proftpd start
/etc/init.d/proftpd stop


Einstellungen in der proftpd.conf


Nun habt ihr zwar einen laufenden FTP Server doch macht dieser bisher noch gar nicht das was er soll.
Die Einstellungen im proftpd verändert man in der Datei

/etc/proftpd.conf 


Ich werde hier nicht genau auf die einzelnen Einstellungen eingehen.
Wer zu einzelenen Funktionen mehr wissen möchte liest bitte im Debian Proftpd Howto von mir nach.

Unter Centos sichern wir uns die alten Einstellungen der config.

mv /etc/proftpd.conf /etc/proftpd.conf.OLD

Es wird eine neue proftpd.conf erstellt→

cat > /etc/proftpd.conf << "EOF"
# This is the ProFTPD configuration file
# $Id: proftpd.conf,v 1.1 2004/02/26 17:54:30 thias Exp $

ServerName			"Proftpd FTP"
ServerIdent			on "FTP Server ready."
ServerAdmin			root@localhost
ServerType			standalone
#ServerType			inetd
DefaultServer			on
AccessGrantMsg			"User %u logged in."
#DisplayConnect			/etc/ftpissue
#DisplayLogin			/etc/ftpmotd
#DisplayGoAway			/etc/ftpgoaway
DeferWelcome			off

# Use this to excude users from the chroot
DefaultRoot			~ ftpuser

# Use pam to authenticate (default) and be authoritative
AuthPAMConfig			proftpd
AuthOrder			mod_auth_pam.c* mod_auth_unix.c

# Do not perform ident nor DNS lookups (hangs when the port is filtered)
IdentLookups			off
UseReverseDNS			off

# Port 21 is the standard FTP port.
Port				21
PassivePorts                    65525 65535

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# Default to show dot files in directory listings
ListOptions			"-a"

# See Configuration.html for these (here are the default values)
#MultilineRFC2228		off
#RootLogin			off
#LoginPasswordPrompt		on
#MaxLoginAttempts		3
#MaxClientsPerHost		none
#AllowForeignAddress		off	# For FXP

# Allow to resume not only the downloads but the uploads too
AllowRetrieveRestart		on
AllowStoreRestart		on

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances			20

# Set the user and group that the server normally runs at.
User				nobody
Group				nobody

# Disable sendfile by default since it breaks displaying the download speeds in
# ftptop and ftpwho
UseSendfile			no

# This is where we want to put the pid file
ScoreboardFile			/var/run/proftpd.score

# Normally, we want users to do a few things.
<Global>
  AllowOverwrite		yes
  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>
</Global>

# Define the log formats
LogFormat			default	"%h %l %u %t \"%r\" %s %b"
LogFormat			auth	"%v [%P] %h %t \"%r\" %s"

<IfModule mod_tls.c>
TLSEngine                  on
TLSLog                     /var/log/proftpd/tls.log
TLSProtocol                SSLv23
TLSOptions                 NoCertRequest
TLSRSACertificateFile      /etc/proftpd/ssl/proftpd.cert.pem
TLSRSACertificateKeyFile   /etc/proftpd/ssl/proftpd.key.pem
TLSVerifyClient            off
TLSRequired                on
</IfModule>

<Global>
RootLogin off
RequireValidShell on
</Global>

<Limit LOGIN>
DenyGroup !ftpuser
</Limit>
EOF

TLS Auth

Für die TLS Installation gehts so weiter:

yum install openssl
mkdir /etc/proftpd
mkdir /etc/proftpd/ssl
openssl req -new -x509 -days 365 -nodes -out /etc/proftpd/ssl/proftpd.cert.pem -keyout /etc/proftpd/ssl/proftpd.key.pem


Nun werden euch ein paar Fragen gestellt..die könnt ihr beantworten…müsst ihr aber nicht.
Geht auch so ;)

Anlegen von Usern und Gruppen chrooted


Wir erstellen eine Gruppe nur für FTP User:

addgroup ftpuser 


Shell ohne Anmeldung:

cp /bin/false /bin/ftp
echo "/bin/ftp" >> /etc/shells


Anlegen von Usern für den FTP:

useradd -s /bin/ftp -G ftpuser -d /HOME/VERZEICHNIS FTP-USERNAME 
passwd FTP-USERNAME 


Wenn ihr mal einen User wieder löschen wollt oder das homeverzeichnis eines Users ändern wollt,
so findet ihr die User alle in der Datei /etc/passwd
Zum Löschen einfach die Datei mit dem Editor eures Vertrauens öffnen und die Zeile mit dem User löschen, speichern, fertig.
Zum Ändern den Pfad zum Homeverzeichniss anpassen, speichern, fertig.


Das wars. Viel Spaß mit proftpd ;)
Gruß
F4RR3LL/Sven

Zurück zum Index

howto/centos_proftpd.txt · Zuletzt geändert: 2022/10/11 10:55 (Externe Bearbeitung)

Seiten-Werkzeuge