PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : proFTPD frage



Holger Voss
09.02.03, 16:59
Hallo,

ich habe den FTP-Server mit einigen User per Shell eingerichtet und es funtioniert auch, nur können die User aus ihrem verzeichnis raus und können das system durchforsten.

wie kann ich das abstellen ?

SYSTEM SuSE 7.3

Gruß Holger

Berufspenner
09.02.03, 17:01
Hi

Chroot ist das Stichwort. Die Suchfunktion sollte da einige Informationen bringen.

Cu
André

taylor
09.02.03, 17:21
Egal um welche Software es geht, ein Blick in die FAQ ist immer hilfreich. Und schwer zu finden war der URL ja jetzt wirklich nicht, das kannst Du auch selbst ;)

http://www.proftpd.de/minifaq.php

Holger Voss
09.02.03, 18:24
Hi,

so es funktioniert nun, die user können nicht mehr aus den Verzeichnis raus.

ich habe per defaultroot /usr/local/public das verzeichnis gesetzt und es ist beschreibbar nur via ftp kann man nichts uploaden.


und nu ???

Download und Upload sollen erlaubt sein mehr nicht

Berufspenner
09.02.03, 18:31
Hi@all

Es ist doch garnicht soweit weg: http://www.proftpd.de/full_faq_de.php#s3

Cu
André

Holger Voss
09.02.03, 19:08
Sorry aber ich bekomme das nicht hin !

Hier ist mal die config:


# 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 "powered by SuSE Linux"
#ServerType inetd
ServerType standalone
ServerAdmin ftpadm@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 proftpd

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

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

#<Directory pub/usr/local/public>
# <Limit STOR>
# AllowAll
# </Limit>
#</Directory>

# Normally, we want files to be overwriteable.
<Directory /usr/local/public>
AllowOverwrite on
HiddenStor on
#HideNoAccess on
</Directory>

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

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

# Do not allow to pass printf-Formats (see also AllowFilter option):
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 off

# Turn off Ident lookups
IdentLookups off

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

# 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
DefaultRoot /usr/local/public


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

taylor
09.02.03, 23:37
Also ich wühle mich nicht durch 100 sowieso auskommentierte Zeilen...

Berufspenner
09.02.03, 23:40
Hi@all

Ein # leitet in einem Configfile immer einen Kommentar ein und dieser wird beim einlesen der Config einfach nicht beachtet. Also solltest du dir mal den untersten Abschnitt bezüglich anonymen Zugriff (dem du ja das schreiben erlauben willst, oder?) angucken, dir den oben geposteten Link angucken und dann die passenden Einträge auskommentieren,

Cu
André

d0cd
10.02.03, 06:11
# !!! 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.

LESEN! ALLLES!

Da steht alles drin was du wissen musst. Bei proFTPd ist es wirklich ganz einfach. Aber wenn du nicht verstehst wie der FTPd arbeitet solltest du auch keinen installieren/administrieren.

Holger Voss
10.02.03, 06:20
Hi,

ich habe jetzt schon alles gelesen und getestet aber es funktioniert nicht mit dem upload.

es soll kein anonymous zugang erfolgen sondern nur für user die am system eingerichtet sind.

ich habe einige beispiele in die config eingefügt aber danach startet der server nicht mehr.

alle user werden in das verzeichnis /usr/local/public verwiesen

aber es geht nur download aber kein upload

:ugly:

d0cd
10.02.03, 06:24
Tausch mal <Directory /usr/local/public> gegen <Directory /> aus. Dann sollte es gehen, falls nicht helfe ich weiter wenn ich wieder zurück bin.

Holger Voss
10.02.03, 06:31
moin,

es geht immer noch nicht

Holger Voss
10.02.03, 19:12
so nun läuft es endlich.

es lag nur an dem PathAllowFilter :(