www.ProFTPD.de

ProFTPD => ProFTPD - Deutsch => Thema gestartet von: 200PulsMan am 09. Juni 2004, 10:36:05



Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 10:36:05
Hallo zusammen,

um es gleich vorweg zu sagen: Ja! Ich habe die Doku gelesen und die Suchfunktion im Forum benutzt. :-)

Trotzdem habe ich ein Problem mit DefaultRoot. Mein ProFTPD (1.2.9) ignoriert die DefaultRoot Anweisung. Der User wird zwar nach dem Verbinden in sein Verzeichnis geleitet, kann aber aus diesem bis in die Hauptebene heraus. Die Rechte habe ich auch geprüft. Habe ich vielleicht beim kompilieren etwas vergessen?? Irgendein Modul oder sowas?? Ich habe den ProFTPD im Debug-Modus gestartet (also -n -d9), daraus konnte ich aber auch keinen Fehler ablesen.

Danke für Eure Hilfe

Hier noch die Debug-Ausgabe:
 - parsing '/usr/local/etc/proftpd.conf' configuration
 - FS: using system open()
 - FS: using system read()
 - FS: using system read()
 - dispatching auth request "getpwnam" to module mod_auth_file
 - dispatching auth request "getpwnam" to module mod_auth_unix
 - dispatching auth request "getgrnam" to module mod_auth_file
 - dispatching auth request "getgrnam" to module mod_auth_unix
 - <Directory /*>: adding section for resolved path '/*'
 - FS: using system read()
 - <Directory /*>: adding section for resolved path '/*'
 - FS: using system read()
 - FS: using system read()
 - FS: using system read()
 - FS: using system read()
 - FS: using system read()
 - FS: using system close()
sub.domain.net -
sub.domain.net - Config for FTP-Server:
sub.domain.net - /*
sub.domain.net -  AllowOverwrite
sub.domain.net -  Umask
sub.domain.net -  AllowForeignAddress
sub.domain.net -  AllowRetrieveRestart
sub.domain.net -  RequireValidShell
sub.domain.net -  MaxClients
sub.domain.net -  MaxClientsPerHost
sub.domain.net -  DefaultChdir
sub.domain.net - DefaultServer
sub.domain.net - Umask
sub.domain.net - TimeoutIdle
sub.domain.net - TimeoutStalled
sub.domain.net - AllowForeignAddress
sub.domain.net - AllowRetrieveRestart
sub.domain.net - IdentLookups
sub.domain.net - RequireValidShell
sub.domain.net - MaxClients
sub.domain.net - MaxClientsPerHost
sub.domain.net - MaxLoginAttempts
sub.domain.net - DefaultChdir
sub.domain.net - DefaultRoot
sub.domain.net - UserID
sub.domain.net - UserName
sub.domain.net - GroupID
sub.domain.net - GroupName
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net - DefaultRoot
sub.domain.net -
sub.domain.net - Config for domain.net Anonymous FTP-Service:
sub.domain.net - /data/www/domain.net/pub/
sub.domain.net -  /*
sub.domain.net -   Limit
sub.domain.net -    DenyAll
sub.domain.net -   MaxClients
sub.domain.net -   AllowOverwrite
sub.domain.net -   RequireValidShell
sub.domain.net -   TransferLog
sub.domain.net -  UserName
sub.domain.net -  GroupName
sub.domain.net -  UserAlias
sub.domain.net -  MaxClients
sub.domain.net -  AllowOverwrite
sub.domain.net -  RequireValidShell
sub.domain.net -  TransferLog
sub.domain.net - AllowOverwrite
sub.domain.net - RequireValidShell
sub.domain.net - TransferLog
sub.domain.net - ExtendedLog
sub.domain.net - dispatching auth request "getgroups" to module mod_auth_file
sub.domain.net - dispatching auth request "getgroups" to module mod_auth_unix
sub.domain.net - SETUP PRIVS at main.c:2704
sub.domain.net - ROOT PRIVS at main.c:1956
sub.domain.net - RELINQUISH PRIVS at main.c:1962
sub.domain.net - ROOT PRIVS at main.c:2323
sub.domain.net - opening scoreboard '/var/run/proftpd.scoreboard'
sub.domain.net - RELINQUISH PRIVS at main.c:2347
sub.domain.net - ROOT PRIVS at inet.c:452
sub.domain.net - RELINQUISH PRIVS at inet.c:510
sub.domain.net - ProFTPD 1.2.9 (stable) (built Tue Jun 8 16:14:37 CEST 2004) standalone mode STARTUP
sub.domain.net - ROOT PRIVS at main.c:2171
sub.domain.net - RELINQUISH PRIVS at main.c:2177
sub.domain.net - FS: using system lstat()


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 10:48:56
:shock:  :shock:
Poste mal bitte die Konfigurationsdatei....


Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 11:03:30
Voila!

Im Prinzip ist die DefaultRoot-Anweisung doppelt vorhanden, nämlich einmal in der Form DefautRoot ~ und dann noch mit Verzeichnisangabe und user. Es funktioniert aber weder das eine noch das andere.
----------------------------------------------------

## This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName         "FTP-Server"
ServerType         standalone
DefaultServer         on

# Port 21 is the standard FTP port.
Port            21

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

# To prevent DoS attacks, set the maximum number of child processes
# to 90.  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         90
TimeoutIdle         400
TimeoutStalled         400
AllowForeignAddress      off
AllowRetrieveRestart      on
UseReverseDNS         off
IdentLookups         off
SyslogFacility         local6
RequireValidShell      off

MaxClients         150
MaxClientsPerHost      10
MaxLoginAttempts      5

DefaultChdir ~/
DefaultRoot ~

# Path to pid file
ScoreboardFile                 /var/run/proftpd.scoreboard

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

# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite      on
</Directory>

# A basic anonymous configuration, no upload directories.
#<Anonymous ~ftp>
#  User            ftp
#  Group         ftp
#  # We want clients to be able to login with "anonymous" as well as "ftp"
#  UserAlias         anonymous ftp
#
#  # 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
#  DisplayFirstChdir      .message
#
#  # Limit WRITE everywhere in the anonymous chroot
#  <Limit WRITE>
#    DenyAll
#  </Limit>
#
#</Anonymous>

LogFormat awstats "%t %h %u %m %f %s %b"

<VirtualHost 192.168.248.102>
  ServerName "domain.net Anonymous FTP-Service"
  AllowOverwrite On
  RequireValidShell off
  TransferLog none
  ExtendedLog /var/log/xferlog-domain read,write awstats
  <Anonymous /data/www/domain.net/pub>
    User   ftp
    Group   ftp
    UserAlias   anonymous ftp
    MaxClients   20
    <Directory /*>
      <Limit WRITE>
        DenyAll
      </Limit>
    </Directory>
  </Anonymous>
</VirtualHost>

# ab hier einige DefaultRoot Anweisungen für ca. 50 User
DefaultRoot /data/www/domain.net username
DefaultRoot ..... usw.


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 11:07:10
Mystisch.
Als wer meldest du dich denn an?
Wo landet der User dann genau und was steht bei ihm in der passwd?

Geht es mit nur einem DefaultRoot ~ ?


Titel: Probleme mit DefaultRoot
Beitrag von: stonki am 09. Juni 2004, 11:14:10
Zitat von: "200PulsMan"
Voila!
# ab hier einige DefaultRoot Anweisungen für ca. 50 User
DefaultRoot /data/www/domain.net username
DefaultRoot ..... usw.


<huestel>
Wollen wir uns die Defaultroot Anleitung noch mal durchlesen ??  :)
</hustel>


Titel: Probleme mit DefaultRoot
Beitrag von: stonki am 09. Juni 2004, 11:15:14
Zitat von: "stonki"
Zitat von: "200PulsMan"
Voila!
# ab hier einige DefaultRoot Anweisungen für ca. 50 User
DefaultRoot /data/www/domain.net username
DefaultRoot ..... usw.


<huestel>
Wollen wir uns die Defaultroot Anleitung noch mal durchlesen ??  :)
</hustel>


mal davon abgesehen, dass alles was man mehr als 5x in der config hat irgendwie der falsche Weg ist. Wie gehen denn die normalen HomeDirs nicht ?

cu
stonki


Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 11:19:26
nein.... nur mit einem defaultroot ~ geht es nicht. auch hier kann ich als irgendein user im system frei herumspazieren.

ich melde mich z.B. als ein eingetragende user an. Die user habe ich ich in folgender weise angelegt.

useradd -d /data/www/homedir.de -s /bin/false -g gruppe username

wenn ich mich dannn als username per FTP verbinde lande ich dann im verzeichnis /data/www/homedir.de. Allerdings kann ich dann auch in die verzeichnisse /data/www/einandershomedir.de rein und munter alles runterladen was ich will, obwohl das verzeichnis einem andern user und gruppe gehört... nur schreiben geht nicht.


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 11:20:25
Zitat von: "Der andere Chef hier"
Wollen wir uns die Defaultroot Anleitung noch mal durchlesen ?? :)

Die Anweisung basiert auf Guppen.  :D  :P  :P

Zitat von: "200PulsMan"
nein.... nur mit einem defaultroot ~ geht es nicht.

Kann doch nicht sein :??


Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 11:26:04
Das ist gewachsen mit der Zeit. Am Anfang waren es nur zwei oder drei DefaultRoots. Im Lauf der Zeit sind immer mehr hinzugekommen. Im Prinzip sind die DefaultRoot Anweisungen unnötig, wenn DefaultRoot ~ funktionieren würde. Aber das macht es eben nicht.  :oops:  :cry:


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 11:27:41
Zitat von: "200PulsMan"
wenn DefaultRoot ~ funktionieren würde. Aber das macht es eben nicht.  :oops:  :cry:

Klar. Man muß nur wollen.

Ich hab auch 200 Puls....



...bald  :lol:  :lol:

Los. Alles raus und EIN Defaultroot ~ rein und restart im Debug-Mode

Eine Frage noch:
Du meldest dich aber nicht da an, oder?
Code:
<VirtualHost 192.168.248.102>


Titel: Probleme mit DefaultRoot
Beitrag von: stonki am 09. Juni 2004, 11:30:38
Zitat von: "200PulsMan"
Das ist gewachsen mit der Zeit. Am Anfang waren es nur zwei oder drei DefaultRoots. Im Lauf der Zeit sind immer mehr hinzugekommen. Im Prinzip sind die DefaultRoot Anweisungen unnötig, wenn DefaultRoot ~ funktionieren würde. Aber das macht es eben nicht.  :oops:  :cry:


ok, aber da es grundsaetzlich funktioniert, lass uns bitte mal Dein Problem loesen und keine haesslichen (und sogar in der syntax falschen) Loesungen basteln. Reduziert bitte Deine COnfig mal um die ganzen "defaultroot" zeilen bis auf "defaultroot ~", desweiteren fuege ausserdem einmal ein "defaultroot ~" in Deinen VirtualHost Block.

cu
stonki


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 11:31:46
Zitat von: "stonki"
Zitat von: "200PulsMan"
Das ist gewachsen mit der Zeit. Am Anfang waren es nur zwei oder drei DefaultRoots. Im Lauf der Zeit sind immer mehr hinzugekommen. Im Prinzip sind die DefaultRoot Anweisungen unnötig, wenn DefaultRoot ~ funktionieren würde. Aber das macht es eben nicht.  :oops:  :cry:


ok, aber da es grundsaetzlich funktioniert, lass uns bitte mal Dein Problem loesen und keine haesslichen (und sogar in der syntax falschen) Loesungen basteln. Reduziert bitte Deine COnfig mal um die ganzen "defaultroot" zeilen bis auf "defaultroot ~", desweiteren fuege ausserdem einmal ein "defaultroot ~" in Deinen VirtualHost Block.

cu
stonki

Meine Rede  8)


Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 11:46:48
Jawohl! So habe ich es gemacht! Alles raus und nur eine DefaultRoot ~ Anweisung rein. Ebenfalls habe diese in den virtuellen Host rein.

Und siehe da! Es geht! Oh Mann... Was für eine Schande!!  :idiot)


Titel: Probleme mit DefaultRoot
Beitrag von: Wörsty am 09. Juni 2004, 11:47:53
Ich nehm ne kleine Cola :ok)


Titel: Probleme mit DefaultRoot
Beitrag von: 200PulsMan am 09. Juni 2004, 11:54:00
bald reichen die 200 Puls nicht mehr! Danke für Eure Mühe und die Geduld mit mir!

Eines ist mir aber trotzdem nicht klar! Warum hat diese Config jahrelang funktioniert und dann aufeinmal nicht mehr?? Wie auch immer! Es ist einfach zu warm heute scheinbar!


Titel: Probleme mit DefaultRoot
Beitrag von: stonki am 09. Juni 2004, 12:01:19
Zitat von: "200PulsMan"
bald reichen die 200 Puls nicht mehr! Danke für Eure Mühe und die Geduld mit mir!

Eines ist mir aber trotzdem nicht klar! Warum hat diese Config jahrelang funktioniert und dann aufeinmal nicht mehr?? Wie auch immer! Es ist einfach zu warm heute scheinbar!


naja, mich wundert das sie ueberhaupt funktioniert hat, denn die Syntax war definitiv falsch ! Aber egal.... Bald ist Wochenende :)

cu
stonki


Titel: Probleme mit DefaultRoot
Beitrag von: Hoaxter am 09. Juni 2004, 18:17:35
Sie hat funktioniert, allerdings nur fuer den letzten Eintrag. D.h. proftpd hat immer versucht alle user in das zuletzt eingetragene DefaultRoot zu chroot()en.
Das stimmte dann immer fuer den zuletzt angelegten user aber fue die anderen _ging_das_definitiv_nicht_! Es sei den die sollten alle ins gleiche $HOME.

Sven