Econnrefused - Connection refused by server

12
J
На сайте с 20.12.2014
Offline
5
2984

После подключения к ФТП некоторое время все работает отлично. Но потом соединение обрывается, порт недоступен и появляется ошибка

Не удалось установить соединение с "ECONNREFUSED - Connection refused by server".

после перезагрузки proftpd, какое-то время опять работает дальше. В чем может быть проблема? Как ее обнаружить и решить?

pupseg
На сайте с 14.05.2010
Offline
364
#1

покажите конфиг proftpd, а так же вывод следующих команд:

ps auxw | grep proftpd

iptables-save > /tmp/ipt && cat /tmp/ipt && rm -rf /tmp/ipt

Качественная помощь в обслуживании серверов. (/ru/forum/661100) Бесплатных консультаций не даю, не помогаю, не обучаю. Минималка от 100$. Как пропатчить KDE-просьба не спрашивать. Есть форумы (http://linux.org.ru) и полезные сайты (http://www.opennet.ru/).
J
На сайте с 20.12.2014
Offline
5
#2

#

# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.

# To really apply changes, reload proftpd after modifications, if

# it runs in daemon mode. It is not required in inetd/xinetd mode.

#

# Includes DSO modules

Include /etc/proftpd/modules.conf

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

UseIPv6 off

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

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

# 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

# Logging onto /var/log/lastlog is enabled but set to off by default

#UseLastlog on

# In order to keep log file dates consistent after chroot, use timezone info

# from /etc/localtime. If this is not set, and proftpd is configured to

# chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight

# savings timezone regardless of whether DST is in effect.

#SetEnv TZ :/etc/localtime

<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://www.securityfocus.com/bid/11430/discuss

# 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

#

# Useful to keep VirtualHost/VirtualRoot directives separated

#

#Include /etc/proftpd/virtuals.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>

# Include other custom configuration files

Include /etc/proftpd/conf.d/

---------- Добавлено 29.03.2015 в 03:59 ----------

ps auxw | grep proftpd вывел

root 22447 0.0 0.3 4196 820 pts/0 S+ 19:57 0:00 grep --color=auto proftpd

iptables-save > /tmp/ipt && cat /tmp/ipt && rm -rf /tmp/ipt ничего не вывел

Andreyka
На сайте с 19.02.2005
Offline
822
#3

Пользуйтесь rsync, там обрывы не страшны

Не стоит плодить сущности без необходимости
J
На сайте с 20.12.2014
Offline
5
#4

логи proftpd


2015-03-29 07:12:26,004 vps-13799.vps-ukraine.com.ua proftpd[24837] localhost (91.212.124.39[91.212.124.39]): USER user: Login successful.
2015-03-29 07:13:05,612 vps-13799.vps-ukraine.com.ua proftpd[24772] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:13:05,612 vps-13799.vps-ukraine.com.ua proftpd[24772] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 08:13:07,431 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): FTP session opened.
2015-03-29 07:13:07,547 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): Preparing to chroot to directory '/home/user'
2015-03-29 07:13:07,548 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): USER user: Login successful.
2015-03-29 07:16:59,043 vps-13799.vps-ukraine.com.ua proftpd[24036] localhost (91.212.124.39[91.212.124.39]): FTP no transfer timeout, disconnected
2015-03-29 07:16:59,050 vps-13799.vps-ukraine.com.ua proftpd[24036] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:16:59,052 vps-13799.vps-ukraine.com.ua proftpd[24036] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 07:19:17,285 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): Passive data transfer failed, possibly due to network issues
2015-03-29 07:19:17,286 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): Check your PassivePorts and MasqueradeAddress settings,
2015-03-29 07:19:17,286 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): and any router, NAT, and firewall rules in the network path.
2015-03-29 07:19:17,286 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): FTP no transfer timeout, disconnected
2015-03-29 07:19:17,292 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:19:17,293 vps-13799.vps-ukraine.com.ua proftpd[24037] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 07:19:18,151 vps-13799.vps-ukraine.com.ua proftpd[24355] localhost (91.212.124.39[91.212.124.39]): Data transfer stall timeout: 600 seconds
2015-03-29 07:19:18,154 vps-13799.vps-ukraine.com.ua proftpd[24355] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:19:18,154 vps-13799.vps-ukraine.com.ua proftpd[24355] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 07:20:23,610 vps-13799.vps-ukraine.com.ua proftpd[24477] localhost (91.212.124.39[91.212.124.39]): Data transfer stall timeout: 600 seconds
2015-03-29 07:20:23,613 vps-13799.vps-ukraine.com.ua proftpd[24477] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:20:23,615 vps-13799.vps-ukraine.com.ua proftpd[24477] localhost (91.212.124.39[91.212.124.39]): notice: user user: aborting transfer: Data connection closed
2015-03-29 07:20:23,616 vps-13799.vps-ukraine.com.ua proftpd[24477] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 07:20:23,678 vps-13799.vps-ukraine.com.ua proftpd[24427] localhost (91.212.124.39[91.212.124.39]): Data transfer stall timeout: 600 seconds
2015-03-29 07:20:23,683 vps-13799.vps-ukraine.com.ua proftpd[24427] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:20:23,684 vps-13799.vps-ukraine.com.ua proftpd[24427] localhost (91.212.124.39[91.212.124.39]): notice: user user: aborting transfer: Data connection closed
2015-03-29 07:20:23,684 vps-13799.vps-ukraine.com.ua proftpd[24427] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 08:43:40,866 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session opened.
2015-03-29 08:43:40,866 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session opened.
2015-03-29 07:43:41,073 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): Preparing to chroot to directory '/home/user'
2015-03-29 07:43:41,073 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): Preparing to chroot to directory '/home/user'
2015-03-29 07:43:41,073 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): USER user: Login successful.
2015-03-29 07:43:41,073 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): USER user: Login successful.
2015-03-29 07:52:04,608 vps-13799.vps-ukraine.com.ua proftpd[24837] localhost (91.212.124.39[91.212.124.39]): Data transfer stall timeout: 600 seconds
2015-03-29 07:52:04,617 vps-13799.vps-ukraine.com.ua proftpd[24837] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:52:04,619 vps-13799.vps-ukraine.com.ua proftpd[24837] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 07:52:04,631 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): Data transfer stall timeout: 600 seconds
2015-03-29 07:52:04,635 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 07:52:04,635 vps-13799.vps-ukraine.com.ua proftpd[24905] localhost (91.212.124.39[91.212.124.39]): FTP session closed.
2015-03-29 08:55:55,202 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session opened.
2015-03-29 07:55:55,608 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): Preparing to chroot to directory '/home/user'
2015-03-29 07:55:55,609 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): USER user: Login successful.
2015-03-29 08:00:08,515 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to seteuid(): Operation not permitted
2015-03-29 08:00:08,515 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to seteuid(): Operation not permitted
2015-03-29 08:00:08,515 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to setegid(): Operation not permitted
2015-03-29 08:00:08,515 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to setegid(): Operation not permitted
2015-03-29 08:00:08,522 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 08:00:08,522 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to seteuid(): Operation not permitted
2015-03-29 08:00:08,522 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): ROOT PRIVS: unable to setegid(): Operation not permitted
2015-03-29 08:00:08,522 vps-13799.vps-ukraine.com.ua proftpd[26257] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session closed.
2015-03-29 08:00:08,523 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 08:00:08,523 vps-13799.vps-ukraine.com.ua proftpd[26658] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session closed.
2015-03-29 08:00:08,525 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-03-29 08:00:08,525 vps-13799.vps-ukraine.com.ua proftpd[26258] localhost (109-162-17-52-klsh.broadband.kyivstar.net[91.212.124.39]): FTP session closed.
pupseg
На сайте с 14.05.2010
Offline
364
#5

сохраните старый конфиг, положите на его место что-то вроде этого:


UseIPv6 on
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 "-al"
DefaultRoot ~
RequireValidShell off
Port 21
MaxInstances 30
User proftpd
Group nogroup
Umask 022 022
AllowOverwrite on

передерните proftpd , попробуйте войти.

RAS
На сайте с 27.11.2005
Offline
126
RAS
#6

Потери пакетов до сервера нет ?

Администрируем сервера, впс, вдс. Ускоряем загрузку сайтов - DLE, Word Press, Joomla, Modx... Настраиваем безопасность. Ручная чистка rootkit/malware/вирусов. (/ru/forum/867860) Разработка - shell/bash/sh/python/perl.
J
На сайте с 20.12.2014
Offline
5
#7

потери пакетов нет

---------- Добавлено 29.03.2015 в 21:19 ----------

pupseg:
передерните proftpd , попробуйте войти.

Если я передерну proftpd и попробую войти то я удачно войду. Другое дело, что спустя время, доступ опять закрывается.

J
На сайте с 20.12.2014
Offline
5
#8

Line 288719: Mar 29 20:45:13 vps-13799 kernel: [158917.361891] Out of memory: Kill process 7590 (apache2) score 8 or sacrifice child

Line 288720: Mar 29 20:45:13 vps-13799 kernel: [158917.364274] Killed process 7620 (php5-cgi) total-vm:285416kB, anon-rss:940kB, file-rss:4kB

Line 288733: Mar 29 20:45:15 vps-13799 kernel: [158919.557499] [<c1125c87>] oom_kill_process+0x167/0x2b0

Line 288799: Mar 29 20:45:15 vps-13799 kernel: [158919.557645] [22115] 0 22115 2742 17 9 347 0 proftpd

Line 288809: Mar 29 20:45:15 vps-13799 kernel: [158919.557663] [ 7469] 1004 7469 3179 1 10 464 0 proftpd

Вот такие записи еще нашел в syslog

Andreyka
На сайте с 19.02.2005
Offline
822
#9

Out of memory

А ларчик просто открывался :)

J
На сайте с 20.12.2014
Offline
5
#10

И как же он открывался?

---------- Добавлено 30.03.2015 в 14:40 ----------

А как это с proftpd связано? У меня и раньше ее бывало не хватало, но фтп работало, если сервер целиком не падал.

---------- Добавлено 30.03.2015 в 14:40 ----------

А как это с proftpd связано? У меня и раньше ее бывало не хватало, но фтп работало, если сервер целиком не падал.

---------- Добавлено 30.03.2015 в 15:03 ----------

Даже если дело и в памяти, можно же как-то сделать, чтобы он proftpd или 21 порт не блокировал.

12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий