PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : proftpd 2 user jeder unterschiedliches verzeichnis



gorxs
08.04.02, 09:47
also folgendes. ich habe benutzer erstellt. nennen wir sie mal web und ftp. der user web sollte nur auf das verzeichnis /var/web/ und unterverzeichnisse zugreifen können und der user ftp sollte nur auf /var/ftp/ zugreifen können.
kann mir jemand sagen wie ich das mache das ein user in eben sein verzeichnis wie oben beschrieben geleitet wird? thx

Nighthawk
08.04.02, 11:15
DefaultRoot /var/web web
DefaultRoot /var/ftp ftp

(also immer "DefaultRoot /ver/zeich/nis user[,user2,user3...]")

gorxs
08.04.02, 12:01
so einfach? cool werd ich geich versuchen.

Nighthawk
08.04.02, 12:26
FTP neustarten nicht vergessen :rolleyes:

gorxs
08.04.02, 12:34
geht nicht so richtig. das prob ist das jeder user im verzeichnis /var/html landet auch der ftp user. poste deshalb mal schnell meine 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 7.3 and ProFTPD"
# 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
# Normally, we want files to be overwriteable.
<Directory /*>
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 /var/html admin
DefaultRoot /var/ftp ftpuser

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


achja den user hab ich so umbenennt da der loginname zu kurz war. und die grösser kleiner zeichen machen leider auch probs :( achja der ftp wurde ohne fehlermeldung neu gestartet ;)

Olli
08.04.02, 14:24
Ich denke, die Direktive heisst:

DefaultRoot ~

Damit ist das ftp-Stammverzeichnis immer das home-Verzeichnis des angemeldeten Users.

oliver

gorxs
08.04.02, 14:28
ah und dann das homeverzeichnis der user als /var/html bzw /var/ftp definieren? hm ginge sicher auch anders werd ich aber versuchen.

Nighthawk
08.04.02, 14:40
~ ist doch nur ein Alias für /home/user, Du kannst genauso gut den vollen Pfad aufschreiben das sollte exakt das gleiche Ergebnis haben (i.d.R. wird man den vollen Pfad verwenden).
Hast Du denn den FTP neu gestartet? Und wenn ja, wie?

Nighthawk
08.04.02, 14:42
PS: Wenn Du DefaultRoot ~ in die Config schreibst, ohne Usernamen, dann werden alle User ausnahmslos in ihre Homeverzeichnisse gechrootet. Also falls Du noch FTP Accounts für Admin usw. hast setz die Usernamen dahinter oder mach's gleich richtig.

gorxs
08.04.02, 14:59
rcproftpd restart hab ich das gemacht. natürlich als root ;)

Nighthawk
09.04.02, 10:29
Muss gehen, starte den Server mal ganz neu oder schieß den FTP komplett ab. Oder hast Du 'ne uralte Version vom FTPd?

gorxs
09.04.02, 11:34
ich habe die von suse 7.3. habe auch keine online updates oder so durchgeführt. ich muss zudem immer den prozess killen damit ich den ftpserver neu starten kann. sonst werden keine änderungen wirksam. ok ist eigentlich kein grosses prob.

Nighthawk
09.04.02, 11:48
Sende dem Daemon doch einfach direkt das HUP, also "kill -HUP pid" das versteht der ProFTPd auch.

gorxs
09.04.02, 12:03
ok also habe noch folgendes problem. hab die conf wie oben nur kann ich mich nicht mehr einloggen. sowie als admin wie auch als ftpuser. kommt immer login failed :( und der server hat die version 1.2.2

Nighthawk
09.04.02, 12:11
Poste mal Deine jetzige Config. Und, um Himmels Willen, lösch vorher die auskommentierten Sektionen raus sonst scrollt man sich 'nen Wolf ;)

gorxs
09.04.02, 12:27
ok es geht jetzt. war wohl ein rechteproblem oder so. auf jedenfall geht es nun. danke.