www.ProFTPD.de
13. März 2007, 19:58:38 *
Willkommen Gast. Bitte einloggen oder registrieren.
Haben Sie Ihre Aktivierungs E-Mail übersehen?

Einloggen mit Benutzername, Passwort und Sitzungslänge
News: SMF - Neu installiert!
 
   Übersicht   Hilfe Suche Login Registrieren  
Seiten: [1] 2   Nach unten
  Drucken  
Autor Thema: Umask pro User oder Gruppe  (Gelesen 551 mal)
0 Mitglieder und 1 Gast betrachten dieses Thema.
timmbo
ProFTPD
*
Offline Offline

Beiträge: 9


Profil anzeigen
« am: 29. November 2003, 15:05:06 »

Hi,


ich wollte einer bestimmten Gruppe oder Verzeichnis eine andere Umask als rw-r-r(133) zuteilen.
Aber auch global unter Umask  022 diese auf 133 zu ändern hat überhaupt nix gebracht, die Files werden immer mit rw-r-r angelegt.

Die Suchfunktion hat auch nix erbracht.

Was kann, soll ich tun?

Timmbo
Gespeichert
stonki
Administrator
ProFTPD
*****
Offline Offline

Beiträge: 1853


15318939
Profil anzeigen WWW E-Mail
« Antwort #1 am: 29. November 2003, 16:15:31 »

Zitat von: "timmbo"
Hi,


ich wollte einer bestimmten Gruppe oder Verzeichnis eine andere Umask als rw-r-r(133) zuteilen.
Aber auch global unter Umask  022 diese auf 133 zu ändern hat überhaupt nix gebracht, die Files werden immer mit rw-r-r angelegt.
Die Suchfunktion hat auch nix erbracht.


poste doch mal Deine Config
Gespeichert

www.stonki.de:    the more I see, the more I know.......
www.proftpd.de:   Deutsche ProFTPD Dokumentation
www.krename.net:  Der Batch Renamer für KDE
www.kbarcode.net: Die Barcode Solution für KDE
timmbo
ProFTPD
*
Offline Offline

Beiträge: 9


Profil anzeigen
« Antwort #2 am: 29. November 2003, 16:38:41 »

# This is a basic ProFTPD configuration file. It establishes a single
# server and a single anonymous login. It assumes that you have a
# user/group "nobody"/"nogroup" for normal operation and anon.

#    !!! PLEASE read the documentation of proftpd !!!
#
# You can find the documentation in /usr/doc/packages/proftpd/,
# http://www.proftpd.org/ and don't forget to read carefully
# and _follow_ hints on http://www.proftpd.net/security.html.

ServerName   ftp.daheim.de      "powered by SuSE Linux"
ServerType         standalone
ServerAdmin         root@localhost
#
# uncomment, if you want to hide the servers name:
#
ServerIdent         on   "FTP Server ready"
DeferWelcome         off
DefaultServer         on

# Enable PAM for authentication...
#
#AuthPAM            on

# Setting this directive to on will cause authentication to fail
# if PAM authentication fails. The default setting, off, allows
# other modules and directives such as AuthUserFile and friends
# to authenticate users.
#
#AuthPAMAuthoritative      off

# This directive allows you to specify the PAM service name used
# in authentication (default is "proftpd" on SuSE Linux).
# You have to setup the service in the /etc/pam.d/<other_name>.
#
#AuthPAMConfig         <other_name>

# Port 21 is the standard FTP port.
Port            21
 




# disable listen on 0.0.0.0:21 - the port (and IP) should
# be specified explicitly in each VirtualHost definition
#
#Port            0



# listen for each (additional) address explicitly that is
# specified (via Bind and Port) in a VirtualHost definition
#
#SocketBindTight                        on


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

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






# Normally, we want files to be overwriteable.
<Directory /*>
  AllowOverwrite      on
  AllowRetrieveRestart      on
  AllowStoreRestart      on
  HiddenStor         off
  HideNoAccess         off
  <Limit READE WRITE EXECUTE>
    AllowAll
  </Limit>
</Directory>







# protect .ftpaccess and similar - see also PathDenyFilter
#<Directory /*.ftp*>
#  <Limit ALL>
#    DenyAll
#    IgnoreHidden      on
#</Directory>

# It is a very good idea to allow only filenames containing normal
# alphanumeric characters for uploads (and not shell code...)
#PathAllowFilter "^[a-zA-Z0-9_.-]+$"
#PathAllowFilter "^[a-zA-Z0-9~ \*\/,_.-]+$"

# We don't want .ftpaccess or .htaccess files to be uploaded
#PathDenyFilter "(\.ftp)|(\.ht)[a-z]+$"
#PathDenyFilter "\.ftp[a-z]+$"

# Do not allow to pass printf-Formats (security! see documentation!):
#AllowFilter "^[a-zA-Z0-9@~' \*\/,_.-]*$"
DenyFilter  "%"

# 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

# Performance: skip DNS resolution when we process the logs...
UseReverseDNS        on

# Turn off Ident lookups
IdentLookups         off

# Set the maximum number of seconds a data connection is allowed
# to "stall" before being aborted.
TimeoutStalled               500

# Where do we put the pid files?
#ScoreboardPath       /var/run/proftpd

#
# Logging options
#
TransferLog          /var/log/xferlog

# Some logging formats
#
#LogFormat            default "%h %l %u %t \"%r\" %s %b"
#LogFormat            auth    "%v [%P] %h %t \"%r\" %s"
#LogFormat            write   "%h %l %u %t \"%r\" %s %b"

# Log file/dir access
#ExtendedLog          /var/log/proftpd.access_log    WRITE,READ write

# Record all logins
#ExtendedLog          /var/log/proftpd.auth_log      AUTH auth

# Paranoia logging level....
##ExtendedLog          /var/log/proftpd.paranoid_log  ALL default


#
# Do a chroot for web-users (i.e. public or www group), but
# do not change root if the user is also in the users group...
#
#DefaultRoot ~/public_html       public,!users
#


#***********************************
#FTP-Berechtigung ab Verzeichnis ...
#***********************************
DefaultRoot /      root
DefaultRoot /home   dvb,t-systems,audio,tools,tauschen,leipzig


#DefaultRoot ~

#****************************************
# Startverzeichnisse der FTP-User der IDS
#****************************************

#User mit FTP-Zugriff ab /
DefaultChdir /                  root


#User mit Zugriff auf mehrere Gruppen benoetigen Zugriff ab /home
#DefaultChdir /home            ids-muc-szuadm,ids-muc-sdviag


#Startverzeichnisse fuer normale User (1 Gruppe)
   Gruppen

DefaultRoot /                  root
DefaultRoot /home/dvb               dvb
DefaultRoot /home/t-systems            t-systems
DefaultRoot /home/audiofiles            audio
DefaultRoot /home/mm_tools            tools

DefaultRoot /home/tauschen            tauschen

DefaultRoot /home/apache/www/kassen         leipzig



# Limit login attempts
MaxLoginAttempts                3

# Users needs a valid shell
#RequireValidShell               yes

#
# Use special Auth files instead....
#
#AuthUserFile                    /var/proftpd/authfiles/passwd
#AuthGroupFile                   /var/proftpd/authfiles/group

#
# Use LDAP server - see README.LDAP
#
#LDAPServer         "localhost"
#LDAPPrefix         "dc=your,dc=domain,dc=top"
#LDAPDN             "cn=YourDNUser,dc=your,dc=domain,dc=top"
#LDAPDNPass         "YourDNUserPassword"


# The ratio directives take four numbers: file ratio, initial file
# credit, byte ratio, and initial byte credit.  Setting either ratio
# to 0 disables that check.
#
# The directives are HostRatio (matches FQDN -- wildcards are allowed
# in this one), AnonRatio (matches password entered in an anon login,
# usually an email address), UserRatio (accepts "*" for 'any user'),
# and GroupRatio.  Matches are looked for in that order.
#
# Some examples:
#
# Ratios     on                                 # enable module
# UserRatio  ftp 0 0 0 0
# HostRatio  anyhost.domain.top 0 0 0 0         # leech access (default)
# GroupRatio proftpd 100 10 5 100000            # 100:1 files, 10 file cred
# AnonRatio  auser@domain.top 1 0 1 0           # 1:1 ratio, no credits
# UserRatio  * 5 5 5 50000                      # special default case
#
# Setting "Ratios on" without configuring anything else will enable
# leech mode: it logs activity and sends status messages to the ftp
# client, but doesn't restrict traffic.


#
# uncomment for anonymous...:
#
#<Anonymous ~ftp>
#     # After anonymous login, daemon runs as:
#     User         ftp
#     Group         public
#
#     # 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      msgs/welcome.msg
#     DisplayFirstChdir      .message
#
#     # Deny write operations to all directories, underneath root-dir
#     # Default is to allow, so we don't need a <Limit> for read operations.
#     <Directory *>
#          <Limit SIZE WRITE>
#               DenyAll
#          </Limit>
#     </Directory>
#     #
#     # Only uploads into incomming directory are allowed...
#     #<Directory incoming>
#     #
#     #     Umask  017
#     #
#     #     # ... so deny read/write
#     #     <Limit READ WRITE DIRS>
#     #          DenyAll
#     #     </Limit>
#     #
#     #     # ... allow file storing, but not other writes
#     #     <Limit STOR CWD CDUP>
#     #          AllowAll
#     #     </Limit>
#     #
#     #</Directory>
#
#</Anonymous>
Gespeichert
stonki
Administrator
ProFTPD
*****
Offline Offline

Beiträge: 1853


15318939
Profil anzeigen WWW E-Mail
« Antwort #3 am: 29. November 2003, 16:43:25 »

Zitat von: "timmbo"

Umask                    113


was ist das eigentlich fuer nen wirrer Wert. Ich kann mir das nur so erklaeren, das ja ein Mode von 553 die Files ausfuehrbar machen wuerden, daher ProFTPD den ignoriert.

uk:/home/stonki/001/Images/test2 # chmod 553 *
uk:/home/stonki/001/Images/test2 # ls -als
insgesamt 5264
   4 drwxrwxrwx    2 root     root         4096 2003-11-20 14:54 .
   4 drwxrwxrwx   11 root     root         4096 2003-11-20 14:54 ..
 744 -r-xr-x-wx    1 root     root       756418 2003-10-04 18:33 im000102.jpg
 776 -r-xr-x-wx    1 root     root       788830 2003-10-04 18:33 im000103.jpg

wirr, aber 113 ist auch nicht besser:
uk:/home/stonki/001/Images/test2 # chmod 113 *
uk:/home/stonki/001/Images/test2 # ls -als
insgesamt 5264
   4 drwxrwxrwx    2 root     root         4096 2003-11-20 14:54 .
   4 drwxrwxrwx   11 root     root         4096 2003-11-20 14:54 ..
 744 ---x--x-wx    1 root     root       756418 2003-10-04 18:33 im000102.jpg
 776 ---x--x-wx    1 root     root       788830 2003-10-04 18:33 im000103.jpg
 764 ---x--x-wx    1 root     root       777623 2003-10-04 18:33 im000104.jpg

sollte also auch nicht gehen.

cu
stonki
Gespeichert

www.stonki.de:    the more I see, the more I know.......
www.proftpd.de:   Deutsche ProFTPD Dokumentation
www.krename.net:  Der Batch Renamer für KDE
www.kbarcode.net: Die Barcode Solution für KDE
timmbo
ProFTPD
*
Offline Offline

Beiträge: 9


Profil anzeigen
« Antwort #4 am: 29. November 2003, 16:47:27 »

Äh, warum 553  Umask 113 wäre doch 664.


Auch ein Ändern in Umask 002 ändert nix.
Er ignoriert die Umask einfach und nimmt
immer 022 her.


Timmbo
Gespeichert
Dominik
Gast
« Antwort #5 am: 29. November 2003, 21:20:16 »

Das kann ich nur bestaetigen und habe ich auch vor kurzem hier gepostet. proftpd nimmt bei mir auch immer nur 022. Habe auch schon vergeblich im Usenet gefragt:


ich habe proftpd mit mod_ifsession kompiliert.

Hier meine proftpd.conf:

#***Start*****
ServerName                      "ProFTPD Server"
ServerType                      standalone
DefaultServer                   on


Port                            21
PassivePorts 3350 3360


<Limit Login>
DenyAll
AllowUser schule ftp test
</limit>

Umask                           022

<Directory /home/schule>
Umask 000
</Directory>


MaxInstances                    30

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

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

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


# FTP-Dir fuer User test auf /tmp setzen
<ifuser test>
  DefaultRoot /tmp
</ifuser>

#<ifuser !test>
  DefaultRoot ~
#</ifuser>


# A basic anonymous FTP server configuration.
<Anonymous /ftpdir>
[..]
</Anonymous>

#***Ende*******


1. Problem:
Ich logge mich als User schule ueber FTP ein und lade eine Datei hoch.
Die erzeugt Datei im System soll die Rechte 777 haben, was ich durch
das Umask 000 erreichen wollte. Es funktioniert aber nicht. Wie
kriege ich hin, dass die in /home/schule erstellten Datein
automatisch alle Rechte haben?

2. Problem:
Ich moechte das der User test nicht in sein Homeverzeichnis bei
FTP-Login gelangt, sondern nach /tmp. Darum habe ich die
ifuser-Anweisung mit eingebaut (musste dafuer proftpd mit
mod_ifsession extra noch mal neukompilieren).
Aber es funktioniert nicht. Er gelangt immer nur in sein
Homeverzeichnis.

Dann habe ich probeweise mal zusaetzlich

<ifuser !test>
  DefaultRoot ~
</ifuser>

eingebaut und das unbedingte DefaultRoot ~ rausgenommen. Dann kommen
alle User (auch test) in ihr Homeverzeichnis, sind aber nicht mehr
chrooted. Also irgendwie funktioniert die ifuser-Bedingung ueberhaupt
nicht. Woran kann das liegen?
Das mod_ifsession Modul ist auf jedenfall miteinkompiliert. proftpd
hat sich naemlich vorher, als ich es noch nicht mit einkompiliert
hatte, auf Grund einer falschen ptoftpd.conf selber gekillt nach
neueinlesen der proftpd.conf

Weiss jemand Rat?

TIA,
Dominik
Gespeichert
Wörsty
Moderator
ProFTPD
*****
Offline Offline

Beiträge: 1602


50772603
Profil anzeigen WWW E-Mail
« Antwort #6 am: 30. November 2003, 15:52:20 »

Blöderweise bin ich gerade nicht zu hause aber fangen wir mal an:

Zitat von: "Dominik"
proftpd nimmt bei mir auch immer nur 022

Probiere ich, wenn ich zu hause bin.
Welche proftpd Versionen habt ihr?

Grundsätzlich kann UMask so verwendet werden, wie ihr das machen wollt.
Hier die Doku

Das mit dem DefaultRoot muß auch gehen.

Server neu gestartet?
Poste mal die Debug-Ausgabe.
Wie sind die Verzeichnisrechte?
Gespeichert

RedHat 8.0 (2.4er Kernel)
proftpd 1.2.10
-mod_sql_mysql
-mow_wrap
-mod_exec
-mod_ifsession[/size]
stonki
Administrator
ProFTPD
*****
Offline Offline

Beiträge: 1853


15318939
Profil anzeigen WWW E-Mail
« Antwort #7 am: 30. November 2003, 17:37:03 »

Zitat von: "Wörsty"
Blöderweise bin ich gerade nicht zu hause aber fangen wir mal an:

Server neu gestartet?
Poste mal die Debug-Ausgabe.
Wie sind die Verzeichnisrechte?


wenn ich nicht das GANZE WE an qmail gehangen haette (ohne Erfolg..) dann wuerde ich das mal testen. Mal sehen, was ich naechste Woche auf Arbeit zu tunhabe...

Womit ich (ausser einen qmail experten) sagen moechte: Kannste das umask problem mal testen bei Dir ?

cu
stonki
Gespeichert

www.stonki.de:    the more I see, the more I know.......
www.proftpd.de:   Deutsche ProFTPD Dokumentation
www.krename.net:  Der Batch Renamer für KDE
www.kbarcode.net: Die Barcode Solution für KDE
Anonymous
Gast
« Antwort #8 am: 30. November 2003, 18:54:05 »

Hi Worsti,


ich hab die 1.2.9.

Timmbo
Gespeichert
Wörsty
Moderator
ProFTPD
*****
Offline Offline

Beiträge: 1602


50772603
Profil anzeigen WWW E-Mail
« Antwort #9 am: 02. Dezember 2003, 08:46:18 »

Bei 1.2.9 stable:
Code:
Umask 0111 0000
-rw-rw-rw-    1 www      www          1692 Dez  2 08:34 telpatch    
drwxrwxrwx    2 www      www          4096 Dez  2 08:34 test

Umask 0113 0113
-rw-rw-r--    1 www      www          1692 Dez  2 08:37 telpatch
drw-rw-r--    2 www      www          4096 Dez  2 08:37 test

Umask 0022 0022
-rw-r--r--    1 www      www          1692 Dez  2 08:38 telpatch
drwxr-xr-x    2 www      www          4096 Dez  2 08:38 test  

Umask 0133 0133
-rw-r--r--    1 www      www          1692 Dez  2 08:39 telpatch
drwxr-xr-x    2 www      www          4096 Dez  2 08:39 test  

Umask 0017 0017
-rw-rw----    1 www      www          1692 Dez  2 08:40 telpatch
drwxrw----    2 www      www          4096 Dez  2 08:40 test  

Umask 0002 0002
-rw-rw-r--    1 www      www          1692 Dez  2 08:41 telpatch
drwxrwxr-x    2 www      www          4096 Dez  2 08:41 test

Umask 0000 0000
-rw-rw-rw-    1 www      www          1692 Dez  2 08:42 telpatch
drwxrwxrwx    2 www      www          4096 Dez  2 08:42 test  

:wink:

Konfig:
Code:
Umask 0111 0000
<Directory /www/vhosts/ftp/test/*>
Umask 0133 0133
</Directory>


Ergibt:
/www/vhosts/ftp/  :arrow:
-rw-rw-rw-    1 www      www          1692 Dez  2 08:51 telpatch
drwxrwxrwx    3 www      www          4096 Dez  2 08:51 test  

/www/vhosts/ftp/test  :arrow:
-rw-r--r--    1 www      www          1692 Dez  2 08:51 subtelpatch
drw-r--r--    2 www      www          4096 Dez  2 08:51 subtest

Wenn du das * am Ende wegläßt greift es für das Verz. /www/vhosts/ftp/test schon!
Also so:
Code:
Umask 0111 0000
<Directory /www/vhosts/ftp/test>
Umask 0022 0022
</Directory>

/www/vhosts/ftp  :arrow:
-rw-rw-rw-    1 www      www          1692 Dez  2 08:57 telpatch
drwxr-xr-x    3 www      www          4096 Dez  2 08:57 test
/www/vhosts/ftp/test  :arrow:
drwxr-xr-x    2 www      www          4096 Dez  2 08:57 subtest
-rw-r--r--    1 www      www          1692 Dez  2 08:57 telpatch

Dass das executable Flag nicht gesetzt wird ist normal.*
Das müßt iht mit einem Script lösen - z.B. über mod_exec + ExecOnCommand + chmod
______________________________________
*Frage und Antwort
Gespeichert

RedHat 8.0 (2.4er Kernel)
proftpd 1.2.10
-mod_sql_mysql
-mow_wrap
-mod_exec
-mod_ifsession[/size]
Anonymous
Gast
« Antwort #10 am: 02. Dezember 2003, 10:01:36 »

Hi Worsty,


hab das jetzt mal so probiert wie Du es geschrieben hast.
Aber nix funzt immer noch rw r r.
Hab sogar um sicher zugehen den Server mal gestoppt und
dann wieder gestartet nicht nur restart.

Was kann es sein?

Timmbo
Gespeichert
Wörsty
Moderator
ProFTPD
*****
Offline Offline

Beiträge: 1602


50772603
Profil anzeigen WWW E-Mail
« Antwort #11 am: 02. Dezember 2003, 11:21:38 »

rw r r ist doch richtig.
Zitat von: "Der liebe Wörsty"
Dass das executable Flag nicht gesetzt wird ist normal

-rw-r--r-- = 0022 = 0133
Weil das Bit für x ignoriert wird. :idea:
Oder nicht  :??
Gespeichert

RedHat 8.0 (2.4er Kernel)
proftpd 1.2.10
-mod_sql_mysql
-mow_wrap
-mod_exec
-mod_ifsession[/size]
timmbo
ProFTPD
*
Offline Offline

Beiträge: 9


Profil anzeigen
« Antwort #12 am: 02. Dezember 2003, 12:22:35 »

Hi,


ich hab's nicht gesagt, mir geht's nicht um das X Flag, sondern
ich will  r rw -  haben.

quasi 0317
Der Grund dafür ist folgender:
Ich möchte per ftp webfiles hochladen, die aber vom Apache-user
nur gelesen werden sollen, von der Gruppe die es aber hochschickt
auch wieder ersetzt bzw. überschrieben werden kann.


Timmbo
Gespeichert
Wörsty
Moderator
ProFTPD
*****
Offline Offline

Beiträge: 1602


50772603
Profil anzeigen WWW E-Mail
« Antwort #13 am: 02. Dezember 2003, 13:08:01 »

Wo ist das Problem?
Code:
Umask 0317 0000

-r--rw----    1 www      www          1692 Dez  2 13:05 telpatch
drwxrwxrwx    2 www      www          4096 Dez  2 13:05 test
oder
Code:
Umask 0111 0000
<Directory /www/vhosts/ftp/test>
Umask 0317 0007
</Directory>

/www/vhosts/ftp/  :arrow:
-rw-rw-rw-    1 www      www          1692 Dez  2 13:07 telpatch
drwxrwx---    2 www      www          4096 Dez  2 13:07 test
/www/vhosts/ftp/test  :arrow:
-r--rw----    1 www      www          1692 Dez  2 13:07 subtelpatch
drwxrwx---    2 www      www          4096 Dez  2 13:07 subtest
Gespeichert

RedHat 8.0 (2.4er Kernel)
proftpd 1.2.10
-mod_sql_mysql
-mow_wrap
-mod_exec
-mod_ifsession[/size]
Anonymous
Gast
« Antwort #14 am: 02. Dezember 2003, 14:23:11 »

Hi,

das denk ich auch, aber es funzt net.
Entweder check ich was nich, oder hab ne kleinigkeit übersehen.

Noch ne Frage:

Du schreibst ja über den Directory auch immer ne Umask, was bedeutet das? Ist das die Umask die oben im config File steht?
Ist es egal wo im File der Befehl mit Umask und Directory steht?

Dank Dir für die Hilfe, wir kommen schon noch drauf.

Timmbo
Gespeichert
Seiten: [1] 2   Nach oben
  Drucken  
 
Gehe zu:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Prüfe XHTML 1.0 Prüfe CSS
Seite erstellt in 0.088 Sekunden mit 16 Zugriffen.