Raspberry Pi als Webserver - FTP-Server (ProFTPD) Installation

    • Offizieller Beitrag

    In folgendem Tutorial zeige ich euch wie ihr einen FTP-Server auf eurem Raspberry Pi installiert.


    Raspberry Pi als Webserver Tutorials:
    1. SSH Zugang auf dem Raspberry Pi einrichten
    2. Raspberry Pi als Webserver - Apache 2 Installation
    3. Raspberry Pi als Webserver - PHP 5 Installation
    4. Raspberry Pi als Webserver - MySQL Installation
    5. Raspberry Pi als Webserver - phpMyAdmin Installation
    6. Raspberry Pi als Webserver - FTP-Server Installation


    1. ProFTPD installieren
    Wir installieren proftpd als standalone

    Code
    sudo apt-get install proftpd


    2. Konfiguration bearbeiten
    Wir begeben uns in den Ordner /etc/proftpd/ und bearbeiten die proftpd.conf

    Code
    sudo nano /etc/proftpd/proftpd.conf

    Da wir virtuelle User vorziehen fügen wir folgenden Code ein:

    Apache Configuration
    DefaultRoot ~
    AuthOrder          	mod_auth_file.c  mod_auth_unix.c
    AuthUserFile /etc/proftpd/ftpd.passwd
    AuthPAM off
    RequireValidShell off



    Tipp Zu Nano:

    Um den Editor zu verlassen und Datei speichern, ist die Tastenkombination Strg + X zu drücken.
    Sollen die Änderungen zwischendurch gespeichert der Editor aber noch nicht verlassen werden, ist Strg + O zu drücken.

    5. Virtuellen User erstellen
    Wechselt als erstes in den Ordner /etc/proftpd/

    Code
    cd /etc/proftpd/

    Wir erstellen nun einen virtuellen User mit dem namen piforum für das Verzeichnis /var/www. Für die nötigen Lese/-Schreibrechte geben wir dem virtuellen User mit dem Parameter --uid und --gid die Rechte des Users "www-data". Mit dem Befehl "id www-data" erfahrt ihr die User/-Ggruppen ID.
    Ihr werdet aufgefordert ein Passwort zu vergeben.

    Code
    sudo ftpasswd --passwd --name piforum --uid 33 --gid 33 --home /var/www/ --shell /bin/false

    6. Server neustarten

    Code
    sudo /etc/init.d/proftpd restart

    ggf. Lese/-Schreibrechte setzten
    Es kann sein, dass Ihr nicht die nötigen Lese/-Schreibrechte auf dem Server habt. Versucht mit folgenden Befehlen die korrekten Rechte zu setzen.

    Code
    chmod g+s /var/www
    chmod 775 /var/www
    chown -R www-data:www-data /var/www

    Nun sollte der FTP-Server auf eurem Raspberry Pi laufen.


    Wenn du Fragen und/oder Verbesserungsvorschläge hast, zögere nicht diese unter diesem Beitrag zu stellen.
    Über ein kurzes Feedback, ob es geklappt hat würde ich mich auch sehr freuen!

    Well in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different way and without fighting and by trying to make it clear and by considering each and every one's opinion, I honestly believe that I completely forgot what I was going to say.

    Einmal editiert, zuletzt von ps915 (21. August 2012 um 18:01)

  • Raspberry Pi als Webserver - FTP-Server (ProFTPD) Installation? Schau mal ob du hier fündig wirst!

  • Guten Tag ersteinmal!

    Ich bin ein totaler linux anfaenger. Die beschreibung ist schon sehr gut, jedoch scheitere ich daran, dass ich nicht weis, wie ich die config datei im terminal speichern kann. Ich fuege den text ein, aber dann ist ende.

    Waere echt nett wenn du mir da helfen koenntest.

    Und noch eins am rande, meine tastatur haengt irgendwie oder schreibt nen buchstaben 100 mal. Unter Win7 ist das nicht der fall. Habt ihr auch solche probleme :huh:

    danke im voraus

    mfg

    matte

  • bei nano speicherst du einfach mit STRG+X

    Das mit der tastatur habe ich auch allerdings weiss ich nicht woran das hängt

  • Speichern kannst du auch mit STRG + O ( nur speichern ) zB. wenn du mal zwischen durch speichern möchtest

    Das Problem mit der Tastatur hatte ich auch bei mir lag es am USB Hub der die Probleme verursacht hat.

    I sometimes feel that I have nothing to say and I want to communicate this.

    Einmal editiert, zuletzt von klecks (19. Juli 2012 um 13:13)

    • Offizieller Beitrag

    Werde es im Tutorial ergänzen! =)

    Well in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different way and without fighting and by trying to make it clear and by considering each and every one's opinion, I honestly believe that I completely forgot what I was going to say.

  • Hallo!
    Erstmal vielen Dank für diese Tutorials, die haben mir schon sehr geholfen.

    Nun hab ich aber mit dem neuen Deabian Wheezy image speziell bei dem FTP-Server am Anfang gleich folgende Meldung:


    Habt ihr irgendeine Idee für mich wie ich den FTP-Server installiert bekomme?

    Lg
    flip_at

  • Erstmal: Herzlich Willkommen im Forum.
    Hast du das ganze mit einem "frischem" System probiert?

    Bevor du etwas installieren kannst, musst du erst die Paketliste aktualisieren.

    Code
    sudo apt-get update


    ggf. noch das System updaten (gehört nicht dazu, empfielt sich aber)

    Code
    sudo apt-get upgrade

    Einmal editiert, zuletzt von SonArc (21. Juli 2012 um 20:42)

  • Hallo, alles nach Anleitung konfiguriert, jedoch erreiche ich den FTP Server nicht von aussen über dyndns.org.
    Im Router habe ich Portweiterleitung auf den PI gesetzt!
    Über LAN geht es, über WAN nicht.
    Auf der Seite http://www.web2ftp.de eingegeben.

    Beim Server meine dyndns.org Adresse eingegeben, Benutzername & Passwort gesetzt, sowie den Port..
    Antwort:
    Fehlgeschlagener Einlogversuch:

    Sie konnten leider nicht eingeloggt werden! Entweder ihre
    Benutzerdaten waren fehlerhaft oder Sie haben keine Berechtigung zum
    Zugriff auf diesen Server!

    Drücken Sie den Zurück-Button und versuchen Sie es erneut! Überprüfen Sie auch das Passwort!

    • Offizieller Beitrag

    Versuche es mal über die WAN IP. Findest du mit http://www.wieistmeineip.de heraus!

    Well in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different way and without fighting and by trying to make it clear and by considering each and every one's opinion, I honestly believe that I completely forgot what I was going to say.

  • geht leider auch nicht....
    Meine dyndns Adresse ist aber gültig. Eine Verbindung auf meine Dreambox von Aussen geht ohne Probleme über Port 80!

    Desweiteren klappt eine Verbindung über Putty von Aussen auf den PI und auf die Dreambox! Ftp Server mehrmalls neugestartet.

    Den FTP Server habe ich in der Config auf Port 25 gesetzt. Im Router Port 25 auf den PI geleitet... Im Lan geht es ohne Probleme nur über WAN geht es nicht....

    Fehlt da evt. irgendwo ein Eintrag für die Berechtigung aus dem WAN in der config Datei ???

    Einmal editiert, zuletzt von knopers1 (12. Oktober 2012 um 16:50)

  • ohjaaa, wusste nicht das Port 25 für email reserviert ist...(Habe FB3790) Später werde ich den Port ändern und es noch einmal versuchen! Bin leider jetzt Arbeiten...
    Hast Du mir dieser Anleitung eine Verbindung über WAN bekommen? Ich bin mir nicht Sicher ob die 100% funktioniert...

    Desweiteren habe ich hier noch was gefunden: http://www.thomas-krenn.com/de/wiki/FTP-Se…bian_einrichten

    Sollte es damit gehen ? Kann erst heute Abend testen.

    Gruß

    EDIT:
    Wie bekomme ich den SYSLOG angezeigt. Bin leider ein Linux Neuling!

    Einmal editiert, zuletzt von knopers1 (12. Oktober 2012 um 18:28)

  • Das Syslog liegt in /var/log. Anzeigen kannst Du das mit 'sudo cat /var/log/messages' oder mit 'sudo tail -f /var/log/messages' fortlaufen die letzten Zeilen.
    Die übliche Zuordnung der Ports zu den Anwendungen findest Du unter /etc/services. Das sind keine Vorschriften sondern nur üblicherweise genutzte Ports, allerdings ist das Forwarding von ftp etwas aufwändiger als bei anderen Protokollen und es kann sein, daß Dein Router das auf Port 25 einfach nicht macht.

    Die Anleitung sollte funktionieren, so anders ist der Pi nicht.

  • hmm, gerade alles auf Port 10000 umgestellt. Geht immer noch nicht über WAN.

    Beim restart bekomme ich die Meldung:
    root@XBian:/etc/proftpd# sudo /etc/init.d/proftpd restart
    [ ok ] Stopping ftp server: proftpd.
    [....] Starting ftp server: proftpdXBian proftpd[2205]: mod_tls_memcache/0.1: notice: unable to registe r 'memcache' SSL session cache: Memcache support not enabled
    . ok

    evt. liegt hier der Fehler ? Im Lan geht aber alles.

    sonst alle nach Anleitung, nur Port von 21 auf 10000 geändert, sowie /media/usb0 und nicht /var/www genommen!

    Einmal editiert, zuletzt von knopers1 (13. Oktober 2012 um 00:17)

  • schau mal in deiner modules.conf nach ob das Modul Memcache überhaupt ohne # davor drin steht..

    Code
    sudo nano /etc/proftpd/modules.conf
    
    
    LoadModule mod_tls_memcache.c

    I sometimes feel that I have nothing to say and I want to communicate this.

  • Ganz am ende der config:

    #LoadModule mod_sftp_sql.c

    LoadModule mod_facl.c
    LoadModule mod_unique_id.c
    LoadModule mod_copy.c
    LoadModule mod_deflate.c
    LoadModule mod_ifversion.c
    LoadModule mod_tls_memcache.c

    # keep this module the last one
    LoadModule mod_ifsession.c


    root@XBian:/var/log/proftpd# cat proftpd.log
    Oct 13 11:26:06 XBian proftpd[1800] localhost: ProFTPD 1.3.4a (maint) (built Fri Jul 20 2012 00:40:30 UTC) stan dalone mode STARTUP
    Oct 13 11:26:48 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): FTP session opened.
    Oct 13 11:26:48 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): wtmp /var/log/wtmp: No such file or directory
    Oct 13 11:26:48 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): Preparing to chroot to dire ctory '/media/usb0'
    Oct 13 11:26:48 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): USER pi: Login successful.
    Oct 13 11:27:05 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): wtmp /var/log/wtmp: No such file or directory
    Oct 13 11:27:05 XBian proftpd[1818] localhost (Asus-X5DIJ.fritz.box[192.168.1.12]): FTP session closed.
    root@XBian:/var/log/proftpd

    Über Lan kein Problem... Ich habe etwas Markiert! Preparing to chrot to directory /media/usb0 ???


    # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
    # To really apply changes, reload proftpd after modifications, if
    # it runs in daemon mode. It is not required in inetd/xinetd mode.
    #

    # Includes DSO modules
    Include /etc/proftpd/modules.conf

    # Set off to disable IPv6 support which is annoying on IPv4 only boxes.
    UseIPv6 off
    # If set on you can experience a longer connection delay in many cases.
    IdentLookups off

    ServerName "Debian"
    ServerType standalone
    DeferWelcome off

    MultilineRFC2228 on
    DefaultServer on
    ShowSymlinks on

    TimeoutNoTransfer 600
    TimeoutStalled 600
    TimeoutIdle 1200

    DisplayLogin welcome.msg
    DisplayChdir .message true
    ListOptions "-l"

    DenyFilter \*.*/

    # Use this to jail all users in their homes
    # DefaultRoot ~
    DefaultRoot ~
    AuthOrder mod_auth_file.c mod_auth_unix.c
    AuthUserFile /etc/proftpd/ftpd.passwd
    AuthPAM off
    RequireValidShell off
    # Users require a valid shell listed in /etc/shells to login.
    # Use this directive to release that constrain.
    # RequireValidShell off

    # Port 21 is the standard FTP port.
    Port 50000

    # In some cases you have to specify passive ports range to by-pass
    # firewall limitations. Ephemeral ports can be used for that, but
    # feel free to use a more narrow range.
    # PassivePorts 49152 65534

    # If your host was NATted, this option is useful in order to
    # allow passive tranfers to work. You have to use your public
    # address and opening the passive ports used on your firewall as well.
    # MasqueradeAddress 1.2.3.4

    # This is useful for masquerading address with dynamic IPs:
    # refresh any configured MasqueradeAddress directives every 8 hours
    <IfModule mod_dynmasq.c>
    # DynMasqRefresh 28800
    </IfModule>

    # 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 30

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

    # Umask 022 is a good standard umask to prevent new files and dirs
    # (second parm) from being group and world writable.
    Umask 022 022
    # Normally, we want files to be overwriteable.
    AllowOverwrite on

    # Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
    # PersistentPasswd off

    # This is required to use both PAM-based authentication and local passwords
    # AuthOrder mod_auth_pam.c* mod_auth_unix.c

    # Be warned: use of this directive impacts CPU average load!
    # Uncomment this if you like to see progress and transfer rate with ftpwho
    # in downloads. That is not needed for uploads rates.
    #
    # UseSendFile off

    TransferLog /var/log/proftpd/xferlog
    SystemLog /var/log/proftpd/proftpd.log

    # Logging onto /var/log/lastlog is enabled but set to off by default
    #UseLastlog on
    # In order to keep log file dates consistent after chroot, use timezone info
    # from /etc/localtime. If this is not set, and proftpd is configured to
    # chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight
    # savings timezone regardless of whether DST is in effect.
    #SetEnv TZ :/etc/localtime

    <IfModule mod_quotatab.c>
    QuotaEngine off
    </IfModule>

    <IfModule mod_ratio.c>
    Ratios off
    </IfModule>


    # Delay engine reduces impact of the so-called Timing Attack described in
    # http://www.securityfocus.com/bid/11430/discuss
    # It is on by default.
    <IfModule mod_delay.c>
    DelayEngine on
    </IfModule>

    <IfModule mod_ctrls.c>
    ControlsEngine off
    ControlsMaxClients 2
    ControlsLog /var/log/proftpd/controls.log
    ControlsInterval 5
    ControlsSocket /var/run/proftpd/proftpd.sock
    </IfModule>

    <IfModule mod_ctrls_admin.c>
    AdminControlsEngine off
    </IfModule>

    #
    # Alternative authentication frameworks
    #
    #Include /etc/proftpd/ldap.conf
    #Include /etc/proftpd/sql.conf
    #
    # This is used for FTPS connections
    #
    #Include /etc/proftpd/tls.conf

    #
    # Useful to keep VirtualHost/VirtualRoot directives separated
    #
    #Include /etc/proftpd/virtuals.conf

    # A basic anonymous configuration, no upload directories.

    # <Anonymous ~ftp>
    # User ftp
    # Group nogroup
    # # We want clients to be able to login with "anonymous" as well as "ftp"
    # UserAlias anonymous ftp
    # # Cosmetic changes, all files belongs to ftp user
    # DirFakeUser on ftp
    # DirFakeGroup on ftp
    #
    # RequireValidShell off
    #
    # # Limit the maximum number of anonymous logins
    # MaxClients 10
    #
    # # We want 'welcome.msg' displayed at login, and '.message' displayed
    # # in each newly chdired directory.
    # DisplayLogin welcome.msg
    # DisplayChdir .message
    #
    # # Limit WRITE everywhere in the anonymous chroot
    # <Directory *>
    # <Limit WRITE>
    # DenyAll
    # </Limit>
    # </Directory>
    #
    # # Uncomment this if you're brave.
    # # <Directory incoming>
    # # # Umask 022 is a good standard umask to prevent new files and dirs
    # # # (second parm) from being group and world writable.
    # # Umask 022 022
    # # <Limit READ WRITE>
    # # DenyAll
    # # </Limit>
    # # <Limit STOR>
    # # AllowAll
    # # </Limit>
    # # </Directory>
    #
    # </Anonymous>

    # Include other custom configuration files
    Include /etc/proftpd/conf.d/


    sudo nano /etc/proftpd/modules.conf

    #
    # This file is used to manage DSO modules and features.
    #

    # This is the directory where DSO modules reside

    ModulePath /usr/lib/proftpd

    # Allow only user root to load and unload modules, but allow everyone
    # to see which modules have been loaded

    ModuleControlsACLs insmod,rmmod allow user root
    ModuleControlsACLs lsmod allow user *

    LoadModule mod_ctrls_admin.c
    LoadModule mod_tls.c

    # Install one of proftpd-mod-mysql, proftpd-mod-pgsql or any other
    # SQL backend engine to use this module and the required backend.
    # This module must be mandatory loaded before anyone of
    # the existent SQL backeds.
    #LoadModule mod_sql.c

    # Install proftpd-mod-ldap to use this
    #LoadModule mod_ldap.c

    #
    # 'SQLBackend mysql' or 'SQLBackend postgres' (or any other valid backend) directives
    # are required to have SQL authorization working. You can also comment out the
    # unused module here, in alternative.
    #

    # Install proftpd-mod-mysql and decomment the previous
    # mod_sql.c module to use this.
    #LoadModule mod_sql_mysql.c

    # Install proftpd-mod-pgsql and decomment the previous
    # mod_sql.c module to use this.
    #LoadModule mod_sql_postgres.c

    # Install proftpd-mod-sqlite and decomment the previous
    # mod_sql.c module to use this
    #LoadModule mod_sql_sqlite.c

    # Install proftpd-mod-odbc and decomment the previous
    # mod_sql.c module to use this
    #LoadModule mod_sql_odbc.c

    # Install one of the previous SQL backends and decomment
    # the previous mod_sql.c module to use this
    #LoadModule mod_sql_passwd.c

    LoadModule mod_radius.c
    LoadModule mod_quotatab.c
    LoadModule mod_quotatab_file.c

    # Install proftpd-mod-ldap to use this
    #LoadModule mod_quotatab_ldap.c
    # Install one of the previous SQL backends and decomment
    # the previous mod_sql.c module to use this
    #LoadModule mod_quotatab_sql.c
    LoadModule mod_quotatab_radius.c
    LoadModule mod_wrap.c
    LoadModule mod_rewrite.c
    LoadModule mod_load.c
    LoadModule mod_ban.c
    LoadModule mod_wrap2.c
    LoadModule mod_wrap2_file.c
    # Install one of the previous SQL backends and decomment
    # the previous mod_sql.c module to use this
    #LoadModule mod_wrap2_sql.c
    LoadModule mod_dynmasq.c
    LoadModule mod_exec.c
    LoadModule mod_shaper.c
    LoadModule mod_ratio.c
    LoadModule mod_site_misc.c
    LoadModule mod_sftp.c
    LoadModule mod_sftp_pam.c
    # Install one of the previous SQL backends and decomment
    # the previous mod_sql.c module to use this
    #LoadModule mod_sftp_sql.c

    LoadModule mod_facl.c
    LoadModule mod_unique_id.c
    LoadModule mod_copy.c
    LoadModule mod_deflate.c
    LoadModule mod_ifversion.c
    LoadModule mod_tls_memcache.c

    # keep this module the last one
    LoadModule mod_ifsession.c
    #


    EDIT1

    jetzt nocheinmal alles auf nacktes Raspian Wheezy 2012-09-18 mit alle updates installiert. Es geht immer noch nicht..
    Lan ja mit winscp mit FTP ohne Verschlüsselung ohne Problem. Von aussen geht nicht.

    Entweder hat sich etwas am Image geändert, oder die Beschreibung nicht zu 100% passend!
    Hat jemand von Euch nach der Anleitung konfiguriert? Geht bei Euch die Verbindung über WAN?

    Einmal editiert, zuletzt von knopers1 (13. Oktober 2012 um 15:01)

    • Offizieller Beitrag

    Nach dieser Anleitung läuft es, gerade ausprobiert. Ich nutzte eine Speedport 503V und habe folgende Regeln definiert:

    Portweiterleitung:
    Regel 1: TCP 21 (dies ist der "DATA Port")
    Regel 2: TCP 22 (dies ist der "Control Port")

    Überpüfe nochmals alle IP Adressen am RPI, Router, Portweiterleitung, und DNS Service!

    Mit Filezilla klappt es bei mir auf Anhieb:

    Die Memcache-meldung verschwindet wenn du das Modul auskommentierst.

    Code
    sudo nano /etc/proftpd/modules.conf
    Code
    # LoadModule mod_tls_memcache.c

    Führe bitte mal folgenden Befehl aus um sicherzugehen dass die Konfigurationsdatei korrekt ist.

    Code
    pi@raspberrypi ~ $ sudo /etc/init.d/proftpd check-config
    ProFTPD configuration OK
    pi@raspberrypi ~ $

    Well in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different way and without fighting and by trying to make it clear and by considering each and every one's opinion, I honestly believe that I completely forgot what I was going to say.

    Einmal editiert, zuletzt von ps915 (13. Oktober 2012 um 18:39)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!