Войти

Показать полную графическую версию : Проблема с proftpd на Debian 5.0


Страниц : [1] 2

NevO
15-01-2011, 19:31
При попытке запустить proftpd получаю ошибку:
Unlimited:~# /etc/init.d/proftpd start
Starting ftp server: proftpd - Fatal: ModulePath: /usr/lib/proftpd is world-writable on line 7 of '/etc/proftpd/modules.conf'
failed!
Unlimited:~#

modules.conf
#
# This file is used to manage DSO modules and features.
#

# This is the directory where DSO modules reside

ModulePath /usr/lib/proftpd

# Allow only user root to load and unload modules, but allow everyone
# to see which modules have been loaded

ModuleControlsACLs insmod,rmmod allow user root
ModuleControlsACLs lsmod allow user *

LoadModule mod_ctrls_admin.c
LoadModule mod_tls.c

# Install one of proftpd-mod-mysql, proftpd-mod-pgsql or any other
# SQL backend engine to use this module and the required backend.
# This module must be mandatory loaded before anyone of
# the existent SQL backeds.
#LoadModule mod_sql.c

# Install proftpd-mod-ldap to use this
#LoadModule mod_ldap.c

#
# 'SQLBackend mysql' or 'SQLBackend postgres' directives are required
# to have SQL authorization working. You can also comment out the
# unused module here, in alternative.
#

# Install proftpd-mod-mysql and decomment the previous
# mod_sql.c module to use this.
#LoadModule mod_sql_mysql.c

# Install proftpd-mod-pgsql and decommen the previous
# mod_sql.c module to use this.
#LoadModule mod_sql_postgres.c

# Install proftpd-mod-sqlite and decomment the previous
# mod_sql.c module to use this
#LoadModule mod_sql_sqlite.c

# Install proftpd-mod-odbc and decomment the previous
# mod_sql.c moduleto use this
#LoadModule mod_sql_odbc.c

LoadModule mod_radius.c
LoadModule mod_quotatab.c
LoadModule mod_quotatab_file.c

# Install proftpd-mod-ldap to use this
#LoadModule mod_quotatab_ldap.c

# Install proftpd-mod-pgsql or proftpd-mod-mysql to use this
#LoadModule mod_quotatab_sql.c
LoadModule mod_quotatab_radius.c
LoadModule mod_wrap.c
LoadModule mod_rewrite.c
LoadModule mod_load.c
LoadModule mod_ban.c
LoadModule mod_wrap2.c
LoadModule mod_wrap2_file.c
# Install proftpd-mod-pgsql or proftpd-mod-mysql to use this
#LoadModule mod_wrap2_sql.c
LoadModule mod_dynmasq.c


# keep this module the last one
LoadModule mod_ifsession.c


ЗЫ. Кто может помочь настроить напишите в асю 109-106-320 пожалуйста

NevO
16-01-2011, 10:44
что никто не знает как решить? :cry: :cry:

ruslandh
16-01-2011, 19:57
ls -l /usr/lib/proftpd

NevO
17-01-2011, 07:18
Unlimited:~# ls -l /usr/lib/proftpd
total 680K
-rw-r--r-- 1 root root 36K 2009-10-29 12:03 mod_ban.so
-rw-r--r-- 1 root root 28K 2009-10-29 12:03 mod_ctrls_admin.so
-rw-r--r-- 1 root root 7.2K 2009-10-29 12:03 mod_dynmasq.so
-rw-r--r-- 1 root root 13K 2009-10-29 12:03 mod_facl.so
-rw-r--r-- 1 root root 13K 2009-10-29 12:03 mod_ifsession.so
-rw-r--r-- 1 root root 49K 2009-10-29 12:03 mod_ldap.so
-rw-r--r-- 1 root root 9.0K 2009-10-29 12:03 mod_load.so
-rw-r--r-- 1 root root 8.0K 2009-10-29 12:03 mod_quotatab_file.so
-rw-r--r-- 1 root root 7.0K 2009-10-29 12:03 mod_quotatab_ldap.so
-rw-r--r-- 1 root root 7.0K 2009-10-29 12:03 mod_quotatab_radius.so
-rw-r--r-- 1 root root 49K 2009-10-29 12:03 mod_quotatab.so
-rw-r--r-- 1 root root 15K 2009-10-29 12:03 mod_quotatab_sql.so
-rw-r--r-- 1 root root 46K 2009-10-29 12:03 mod_radius.so
-rw-r--r-- 1 root root 21K 2009-10-29 12:03 mod_ratio.so
-rw-r--r-- 1 root root 36K 2009-10-29 12:03 mod_rewrite.so
-rw-r--r-- 1 root root 12K 2009-10-29 12:03 mod_site_misc.so
-rw-r--r-- 1 root root 22K 2009-10-29 12:03 mod_sql_mysql.so
-rw-r--r-- 1 root root 22K 2009-10-29 12:03 mod_sql_postgres.so
-rw-r--r-- 1 root root 72K 2009-10-29 12:03 mod_sql.so
-rw-r--r-- 1 root root 83K 2009-10-29 12:03 mod_tls.so
-rwxrwxrwx 1 root root 9.5K 2011-01-02 20:37 mod_unique_id.so
-rw-r--r-- 1 root root 9.3K 2009-10-29 12:03 mod_wrap2_file.so
-rw-r--r-- 1 root root 28K 2009-10-29 12:03 mod_wrap2.so
-rw-r--r-- 1 root root 7.6K 2009-10-29 12:03 mod_wrap2_sql.so
-rw-r--r-- 1 root root 17K 2009-10-29 12:03 mod_wrap.so
Unlimited:~#

ruslandh
17-01-2011, 12:33
А
ls -ld /usr/lib/proftpd

NevO
17-01-2011, 16:15
Unlimited:~# ls -ld /usr/lib/proftpd
drwxrwxrwx 2 root root 4.0K 2011-01-12 19:56 /usr/lib/proftpd
Unlimited:~#

ruslandh
17-01-2011, 21:11
Похоже, нужно установить права на папку /usr/lib/proftpd -rw-r--r-- 1 root root

NevO
17-01-2011, 21:16
Unlimited:~# chmod -rw-r--r-- /usr/lib/proftpd
chmod: /usr/lib/proftpd: new permissions are --x-wx-wx, not --x--x--x
Unlimited:~# /etc/init.d/proftpd start
Starting ftp server: proftpd - warning: unable to include '/etc/proftpd.d/modules.conf': No such file or directory
- Fatal: ModulePath: /usr/lib/proftpd is world-writable on line 11 of '/etc/proftpd/proftpd.conf'
failed!
Unlimited:~#

ruslandh
17-01-2011, 23:26
Ну, chmod надо было наверно так:
chmod 644 /usr/lib/proftpd

NevO
18-01-2011, 06:50
Unlimited:~# chmod 644 /usr/lib/proftpd
Unlimited:~# /etc/init.d/proftpd start
Starting ftp server: proftpd - warning: unable to include '/etc/proftpd.d/modules.conf': No such file or directory
- warning: handling possibly truncated configuration data at line 117 of '/etc/proftpd/proftpd.conf'
.
Unlimited:~#

ruslandh
18-01-2011, 17:10
unable to include '/etc/proftpd.d/modules.conf': No such file or directory

От какого пользователя запускается proftpd

vadblm
18-01-2011, 17:55
chmod 644 /usr/lib/proftpd »
И сделать его нечитаемым для всех.

$ mkdir test
$ touch test/foo
$ ls test
foo
$ file test/foo
test/foo: empty
$ chmod 644 test
$ ls test
ls: невозможно получить доступ к test/foo: Отказано в доступе
foo
$ file test/foo
test/foo: cannot open `test/foo' (Permission denied)

Такие дела.


"x" для каталогов это право на поиск, так что правильно было бы
chmod 755 /usr/lib/proftpd

NevO
18-01-2011, 19:24
ruslandh, запускаю под root

vadblm, chmod 755 прокатил)
Unlimited:~# chmod 755 /usr/lib/proftpd
Unlimited:~# /etc/init.d/proftpd start
Starting ftp server: proftpd.
Unlimited:~#

но теперь не могу зайти на фтп. Ни под анонимом ни под рутом.
proftpd.conf


# /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 on
# If set on you can experience a longer connection delay in many cases.
IdentLookups off

ServerName "Debian"
ServerType standalone
DeferWelcome off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200

DisplayLogin welcome.msg
DisplayChdir .message true
ListOptions "-l"

DenyFilter \*.*/

# Use this to jail all users in their homes
# DefaultRoot ~

# Users require a valid shell listed in /etc/shells to login.
# Use this directive to release that constrain.
# RequireValidShell off

# 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

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress 1.2.3.4

# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

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

# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd off

# This is required to use both PAM-based authentication and local passwords
# AuthOrder mod_auth_pam.c* mod_auth_unix.c

# 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

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</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 off
ControlsMaxClients 2
ControlsLog /var/log/proftpd/controls.log
ControlsInterval 5
ControlsSocket /var/run/proftpd/proftpd.sock
</IfModule>

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

#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf

# 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
# 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
# DisplayChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
# <Directory *>
# <Limit WRITE>
# 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>
DefaultRoot ~
ListOptions "-la"

папка фтп (home/ftp) принадлежит ftp nogroup

vadblm
18-01-2011, 19:53
Ни под анонимом ни под рутом. »
"Анонимная" секция у вас закомментирована, а рута по умолчанию по фтп никто не пускает (см. ftpusers(5)).
Попробуйте зайти обычным пользователем.

NevO
18-01-2011, 20:17
vadblm, создать простого пользователя и им зайти?

Создал обычного пользователя, попробовал им зайти. Результат 0

vadblm
18-01-2011, 20:27
что в логах?

NevO
18-01-2011, 20:29
Всмысле?
Может перейдем лучше в скайп или аську чтобы тут не флудить?

vadblm
18-01-2011, 20:34
Всмысле? »
Что пишется в журналы

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

NevO
18-01-2011, 20:39
xferlog - пуст
proftpd.log:
Jan 01 06:52:03 Unlimited proftpd[3053] custom: ProFTPD killed (signal 15)
Jan 01 06:52:03 Unlimited proftpd[3053] custom: ProFTPD 1.3.1 standalone mode SHUTDOWN

vadblm
18-01-2011, 20:54
Jan 01 06:52:03 Unlimited proftpd[3053] custom: ProFTPD killed (signal 15)
Jan 01 06:52:03 Unlimited proftpd[3053] custom: ProFTPD 1.3.1 standalone mode SHUTDOWN »
Так выключен же сервер, вот и не пускает - некому пускать :)
Вообще, проверить работает или нет можно командой netstat -vtnl | grep 21
Если выдаёт что-то типа

tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN

то значит работает, если пусто - не работает.




© OSzone.net 2001-2012