ProFTPD и .ftpaccess

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС.

Модераторы: SLEDopit, Модераторы разделов

Аватара пользователя
asux
Сообщения: 49
ОС: Gentoo

ProFTPD и .ftpaccess

Сообщение asux »

Здравствуйте.
У меня есть фотографии, и я хотел сделать так чтобы мои друзья могли скачивать прямо с моего компа. Пробовал это сделать с помощью Апача, не получилось. Поставил ProFTPD, создал файл .ftpaccess:

Код: Выделить всё

<Limit All>
    DenyAll
</Limit>

AllowOverride включен, но всеравно proftpd игнорирует его, т.к. браузер (и не только он) заходит в эту папку. Конфиг:

Код: Выделить всё

#
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6                off

ServerName            "My ProFTPD server on Debian GNU/Linux 4.0"
ServerType            standalone
DeferWelcome            off

MultilineRFC2228        on
DefaultServer            on
ShowSymlinks            on

TimeoutNoTransfer        600
TimeoutStalled            600
TimeoutIdle            60

DisplayLogin                    welcome.msg
DisplayFirstChdir               .message
ListOptions                    "-l"

DenyFilter            \*.*/

# General Server Context.
tcpBackLog                 10
UseReverseDNS              off

# Global Server Context.
<Global>
  DeleteAbortedStores       on
  MaxClients                10
  MaxLoginAttempts           3
  TransferRate               APPE,RETR,STOR,STOU 3000:10000000
  ServerIdent               on "Ok"
  Umask                     022
AllowOverwrite            on
AllowOverride             on
CommandBufferSize          50
IdentLookups               off
DefaultRoot ~ftp
RequireValidShell off
AuthUserFile /var/secure/.ftpasswd
AuthGroupFile /var/secure/.ftgroup
</Global>

# Port 21 is the standard FTP port.
Port                21

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                    49152 65534

# 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

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

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask                022  022
# Normally, we want files to be overwriteable.
#AllowOverwrite            on
#AllowOverride             on
# Uncomment this if you are using NIS or LDAP to retrieve passwords:
# PersistentPasswd        off

# Be warned: use of this directive impacts CPU average load!
#
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
# UseSendFile            off

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

PathDenyFilter "(^\.ftpaccess$)"

<Directory /*>
    <Limit WRITE STOR>
        DenyAll
    </Limit>
    <Limit LOGIN READ>
        Order allow,deny
        AllowGroup admins,friends,class,family,chem
        DenyUser anonymous ftp
        DenyAll
    </Limit>
</Directory>
<Directory /upload/*>
    <Limit LOGIN READ STOR>
        Order allow,deny
        AllowGroup admins,friends,class,family,chem
        DenyUser anonymous ftp
        DenyAll
    </Limit>
</Directory>

#<IfModule mod_auth_file.c>
#</IfModule>

<IfModule mod_tls.c>
TLSEngine off
</IfModule>

<IfModule mod_quota.c>
QuotaEngine on
</IfModule>

<IfModule mod_ratio.c>
Ratios on
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        on
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine on
</IfModule>

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
#   User                ftp
#   Group            nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias            anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser    on ftp
#AuthPAMAuthoritative       on
#MultilineRFC2228           on
#AllowFilter                "^[a-zA-Z0-9 ,.,-]*$"
#   DirFakeGroup on ftp
#
#   RequireValidShell        off
#
#   # 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
#   <Directory *>
#    <Limit LOGIN READ>
#        DenyAll
#        #AllowAll
#    </Limit>
#     <Limit WRITE STOR>
#       DenyAll
#     </Limit>
#   </Directory>
#    <Directory /Photos>
#        <Limit LOGIN READ WRITE STOR>
#            DenyAll
#        </Limit>
#    </Directory>
#
#   # Uncomment this if you're brave.
#   # <Directory incoming>
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask                022  022
#   #            <Limit READ WRITE>
#   #            DenyAll
#   #            </Limit>
#   #            <Limit STOR>
#   #            AllowAll
#   #            </Limit>
#   # </Directory>
#
# </Anonymous>


Подскажите что где исправить.
Всем спасибо.
Athlon64 3800+ X2 | 1GB | 400GB | Gentoo Linux | KDE 4.3.1
Eee PC 1005HA | Sabayon Linux 5.0 | KDE 4.3.1
Спасибо сказали:
Аватара пользователя
n2j2r
Сообщения: 494
Статус: najar

Re: ProFTPD и .ftpaccess

Сообщение n2j2r »

1 .ftpaccess верно заполняете?
2 поробуйте AllowOverride поставить выше <Global>
Спасибо сказали:
Аватара пользователя
asux
Сообщения: 49
ОС: Gentoo

Re: ProFTPD и .ftpaccess

Сообщение asux »

Наконец-то настроил! :D Оказалась ошибка в названии файла и почему-то профтпд непонимает AllowGroup group1,group2..., пришлось писать
AllowGroup group1
AllowGroup group2
...
Athlon64 3800+ X2 | 1GB | 400GB | Gentoo Linux | KDE 4.3.1
Eee PC 1005HA | Sabayon Linux 5.0 | KDE 4.3.1
Спасибо сказали:
Аватара пользователя
qwerty
Сообщения: 72

Re: ProFTPD и .ftpaccess

Сообщение qwerty »

Разрешить доступ только тем, кто входит сразу в обе группы

<Limit READ WRITE DIRS>
AllowGroup group1,group2
</Limit>

Разрешить доступ всем членам обоих групп

<Limit READ WRITE DIRS>
AllowGroup group3
AllowGroup group4
</Limit>

Вот в чем соль =)
Спасибо сказали: