Hallo Leute, ich lege einen User an, der auch FTP-Zugriff hat auf seinen Account. Nun möchte ich aber einen 2ten User anlegen, der auf das gleiche Verzeichnis oder eines unterverzeichnisses in dem Haupt-FTP-User zugriff hat (write,del,etc.). Jemand eine Idee wie ? Einfach mit useradd den 2ten User anlegen auf der gleiche Verzeichnis wie der Haupt-user? Danke für Hilfe, Thorsten
T. Hantke wrote:
Hallo Leute,
ich lege einen User an, der auch FTP-Zugriff hat auf seinen Account.
Welcher FTP läuft denn? Ich habe bei mir den ProFTPd laufen, mit eigenem MySQL-Authorisation, darin 2 unterschiedliche Usernamen/Passwörtern, mit identischer UID und GID und identischem Homeverzeichnis. Läuft tadellos, wieso also 2 User anlegen? Gruß Jens
[...]
Hallo Jens,
Welcher FTP läuft denn?
proftpd Es geht darum, einen user anzulegen. Der User kann/darf nun seine Webseiten in dieses Verzeichnis legen (welche über seine Domain dann erreichbar sind). Nun soll ein 2ter User (Unter-User) aber auch die Möglichkeit haben, hier drauf zuzugreifen, und Dateien hochzuladen, zu löchen, etc. Möglich, wenn ja, wie nur? Gruß Thorsten Hantke
Am Montag, 3. Juni 2002 11:43 schrieb T. Hantke:
proftpd :-)
Es geht darum, einen user anzulegen. Der User kann/darf nun seine Webseiten in dieses Verzeichnis legen (welche über seine Domain dann erreichbar sind).
Nun soll ein 2ter User (Unter-User) aber auch die Möglichkeit haben, hier drauf zuzugreifen, und Dateien hochzuladen, zu löchen, etc.
ich verstehe irgendwie das Problem nicht. Das hat IMHO wenig mit dem FTP Server zu tun, sondern eher mit Standard Unix rechten. Pass doch einfach die Unix Rechte an, daß der andere die Dateien löschen kann.. Und beiden gibst Du natürlich das gleiche HomeDir und sperrtst sie da ein. Oder mach ich mir das mal wieder zu einfach ? cu stonki -- Deutsche ProFTPD Dokumentation: http://www.stonki.de EFNET: #proftpd
T. Hantke wrote:
Hallo Jens,
[...]
Es geht darum, einen user anzulegen. Der User kann/darf nun seine Webseiten in dieses Verzeichnis legen (welche über seine Domain dann erreichbar sind).
Nun soll ein 2ter User (Unter-User) aber auch die Möglichkeit haben, hier drauf zuzugreifen, und Dateien hochzuladen, zu löchen, etc.
Möglich, wenn ja, wie nur?
Äh ich meinte genau dass beschrieben zu haben, aber egal, nochmal etwas detaillierter, und ohne SQL-Modul mod_sql: Lege eine Datei an, z.B. /etc/proftpd.users, mit dem Inhalt $USER1:$CRYPTPASS:$UID:$GID::$HOME:/bin/false $USER2:$PASSCRYPT:$UID:$GID::$HOME:/bin/false Wobei gilt: - $USER1: der "echte" User - $USER2: der "Clone" - $CRYPTPASS und $PASSCRYPT zwei (unterschiedliche) mit crypt encoded Passwörter - $UID die UserID des "echten" Users (und zwar in beiden Fällen die gleiche - $GID die GroupID (siehe $UID) - $HOME das Homedir des "echten" Users Also z.B.: foo:TRyaZ4VlOJHec:701:700::/home/foo:/bin/false bar:yAFethrjkKZ95:701:700::/home/foo:/bin/false Dann packst du in deine /etc/proftpd.conf die Zeile AuthUserFile /etc/proftpd.users Startest den FTP neu und hast das gewünschte Ergebnis. Nachteil: du kannst über das Ownership der Datei nicht nachvollziehen, wer die Datei erzeugt hat, aber je nach Logging-Einstellungen kannst du es im Logfile sehen. Gruß Jens
Hallo
Lege eine Datei an, z.B. /etc/proftpd.users, mit dem Inhalt
$USER1:$CRYPTPASS:$UID:$GID::$HOME:/bin/false $USER2:$PASSCRYPT:$UID:$GID::$HOME:/bin/false
Wobei gilt: - $USER1: der "echte" User - $USER2: der "Clone" - $CRYPTPASS und $PASSCRYPT zwei (unterschiedliche) mit crypt encoded Passwörter - $UID die UserID des "echten" Users (und zwar in beiden Fällen die gleiche - $GID die GroupID (siehe $UID) - $HOME das Homedir des "echten" Users
Also z.B.: foo:TRyaZ4VlOJHec:701:700::/home/foo:/bin/false bar:yAFethrjkKZ95:701:700::/home/foo:/bin/false
Dann packst du in deine /etc/proftpd.conf die Zeile
AuthUserFile /etc/proftpd.users
so.... eine user.ftp datei einfach angelegt wie folgt: f7204464:khjSZ5VtCZ3KU:1000:1000::/home/f7204464:/bin/false hantke:5d6kRZ2Z582bU:1000:1000::/home/f7204464:/bin/false dann in der Datei /etc/proftpd.conf die Zeile AuthUserFile /etc/proftpd.users eingetragen - der hauptuser (der wirklich als user auch existiert) kommt per ftp drauf, beim 2ten unteruser heißt es immer password incorrekt. Was mach ich falsch? Oder muß der unter-ftp-user auch als wirklicher user angelegt werden? denke doch nicht, oder? in der proftpd-doku finde ich auch nichts weiter zum authuserfile-befehl. Danke für die Hilfe nochmals, Gruß Thorsten
Hi Thorsten, Am Sonntag, 2. Juni 2002 22:13 schrieb T. Hantke:
ich lege einen User an, der auch FTP-Zugriff hat auf seinen Account.
Nun möchte ich aber einen 2ten User anlegen, der auf das gleiche Verzeichnis oder eines unterverzeichnisses in dem Haupt-FTP-User zugriff hat (write,del,etc.).
Jemand eine Idee wie ? Einfach mit useradd den 2ten User anlegen auf der gleiche Verzeichnis wie der Haupt-user?
na mach doch eine Gruppe, z.B. "Profilneurotiker" *g* und in die Gruppe steckst Du die beiden User. Das Verzeichnis gibst Du der Gruppe und richtest für die Gruppe auch die entsprechenden Rechte ein. Zwei User mit Zugriff auf das gleiche Home müsste rein theoretisch fehlschlagen, da die User ja über ihre UID verwaltet werden und beide aber unterschiedliche UIDs haben, womit das Verzeichnis wiederum nur einem gehört. Gruß Philipp -- registered Linux user number 258854
Philipp Zacharias <philipp.zacharias@gmx.net> schrieb:
Zwei User mit Zugriff auf das gleiche Home müsste rein theoretisch fehlschlagen, da die User ja über ihre UID verwaltet werden und beide aber unterschiedliche UIDs haben, womit das Verzeichnis wiederum nur einem gehört.
Was natürlich geht, sind zwei User mit der gleichen UID. So kann es z.B. die User root und toor geben (Bei FreeBSD üblich, da die bash dort unter /usr/local liegt und somit nicht immer zur Verfügung stehen könnte. Daher zwei User mit zwei unterschiedlichen Shells). Dieses Vorgehen halte ich aber für "unüblich". Ich denke auch, dass die Profilneurotiker hier die richtige Lösung sind :) Die Verzeichnisfrage würde ich aber mit Symlinks machen. Also z.B. /work/proj1 <-- Gruppe proj1 /work/proj1/berichte <-- Gruppe proj1pub /home/anton/proj1 -> /work/proj1 /home/berta/proj1ber -> /work/proj1/berichte /etc/groups: proj1: anton proj1pub: anton,berta "<--" zeigt, wem das Verzeichnis gehört "->" zeigt einen Symlink Diese Trennung ist gut, da sich sonst in den Fenster "Dotfiles" finden. Es sei denn, es sollte keine Logins und so geben, aber man weiss nie, welche Prozesse unter dem User mal laufen und dann etwas schreiben! Mit den besten Grüßen, Konrad Neitzel -- SoftMediaTec GmbH Tel: 0172 / 689 31 45 Fax: 069 / 90 50 99 53
Am Montag, 3. Juni 2002 07:28 schrieb Konrad Neitzel: Moin Moin,
/work/proj1 <-- Gruppe proj1 /work/proj1/berichte <-- Gruppe proj1pub /home/anton/proj1 -> /work/proj1 /home/berta/proj1ber -> /work/proj1/berichte
das würde aber bedeuten, daß man kein CHROOT ausführen kann, da dieses nicht über symlinks klappt. cu stonki -- Deutsche ProFTPD Dokumentation: http://www.stonki.de EFNET: #proftpd
Stefan Onken <support@stonki.de> schrieb:
Am Montag, 3. Juni 2002 07:28 schrieb Konrad Neitzel:
/work/proj1 <-- Gruppe proj1 /work/proj1/berichte <-- Gruppe proj1pub /home/anton/proj1 -> /work/proj1 /home/berta/proj1ber -> /work/proj1/berichte
das würde aber bedeuten, daß man kein CHROOT ausführen kann, da dieses nicht über symlinks klappt.
Das ist richtig! Der Sicherheitsaspekt ist noch gar nicht beleuchtet worden. Ich würde für Datentransfers ehh kein FTP nehmen, FTP ein unsicheres Protokoll ist und Alles unverschlüsselt über das Netz geht. Wenn es unbedingt FTP sei muss, dann eher eine Lösung mit eigenen FTP Nutzern, die extrem beschränkte Rechte haben (Schreibzugriff nur in incoming Verzeichnissen und unterschiedlich zu den real existierenden User. Ich denke, dass es viele andere Möglichkeiten gibt wie z.B. sftp! Ich mag auch sehr gerne CVS Trees, die dann via SSH geupdated werden können. Ich nutze FTP immer nur maximal für den anonymen Zugriff und dort dann natürlich in einer eigenen CHROOT Umgebung. Es sollte ehh viel mehr darauf geachtet werden, dass alle unverschlüsselten Dienste genau kontrolliert werden und im Zweifelsfalle deaktiviert werden. (Telnet erlauben ja auch noch sehr viele! Und auch pop3 ist ja unverschlüsselt! Es gibt Alternativen und diese sollte man doch tunlichts nutzen!) Mit den besten Grüßen, Konrad Neitzel -- SoftMediaTec GmbH Tel: 0172 / 689 31 45 Fax: 069 / 90 50 99 53
"T. Hantke" <linux@vitus-2.de> schrieb:
ich lege einen User an, der auch FTP-Zugriff hat auf seinen Account.
Nun möchte ich aber einen 2ten User anlegen, der auf das gleiche Verzeichnis oder eines unterverzeichnisses in dem Haupt-FTP-User zugriff hat (write,del,etc.).
Jemand eine Idee wie ? Einfach mit useradd den 2ten User anlegen auf der gleiche Verzeichnis wie der Haupt-user?
Die Zugriffsrechte haben erst einmal nicht mit den Verzeichnissen zu tuen. Du kannst die User, die Zugriff auf ein Verzeichnis oder eine Datei haben sollen, in eine Gruppe legen und dann dafür sorgen, dass diese Gruppe als Besitzer eingetragen ist und dass diese Gruppe die entsprechenden Rechte hat. Hier sehe ich aber dann auch noch ein Problem: Wenn ein User xyz eine neue Datei anlegt, dann ist als Gruppe die Gruppe aus der /etc/passwd eingetragen. Diese ist aber zwangsläufig nicht die Gruppe, die Du haben willst. Beispiel: Die Dateien vom Webserver sind von der Gruppe "webadmn". anton und berta sind User. Diese haben in /etc/passwd die Gruppe 100 (users) eingetragen. In /etc/group stehen anton und berta in der Gruppe webadmn. Wenn nun anton eine Datei aufspielt, wird diese anton.users gehören. In Sache Zugriffsrechte ist interessant: chmod, chown Verzeichnis: Das Homeverzeichnis ist der Anfangspunkt bei ftp-Verbindungen. Ich halte es aber für unschön, dies direkt auf "Arbeitsverzeichnisse" zeigen zu lassen. Ich neige dazu, den Usern Symlinks in Ihr Homezeichnis zu legen. Dann können diese ohne Probleme auf alles zugreifen (und ein User kann in mehreren Projekten mitarbeiten). Was genau willst Du machen? Ich arbeite sehr gerne mit cvs. So kann man Webseiten in einem CVS-Tree halten und Änderungen immer schön nachvollziehen. Die Webseiten selbst aktualisieren sich dann von Zeit zu Zeit über einen cron-job (Läuft bei mir stündlich). Grosse Binary-Dateien sind IMHO da aber dann ungeeignet! Mit den besten Grüßen, Konrad Neitzel -- SoftMediaTec GmbH Tel: 0172 / 689 31 45 Fax: 069 / 90 50 99 53
participants (5)
-
Jens Ott
-
Konrad Neitzel
-
Philipp Zacharias
-
Stefan Onken
-
T. Hantke