Problemas para configurar um servidor FTP com o Proftpd

1. Problemas para configurar um servidor FTP com o Proftpd

Paulo Roberto
paulorobertoess

(usa Ubuntu)

Enviado em 26/07/2015 - 18:07h

Prezados, tenho um servidor Ubuntu, com o Proftpd rodando em um servidor EC2 da Amazon, quando tento me conectar com o FileZilla obtenho o erro:
Erro: A conexão excedeu limite de tempo
Erro: Falha na obtenção da lista de pastas

Se eu checar com o ftptest.net tenho esse resultado:

Status: Connected, waiting for welcome message...
Reply: 220 FTP Server ready.
Command: CLNT [url=https://ftptest.net]https://ftptest.net[/url] on behalf of 187.74.89.5
Reply: 500 CLNT not understood
Command: USER lya
Reply: 331 Password required for lya
Command: PASS **************
Reply: 230 User lya logged in
Command: SYST
Reply: 215 UNIX Type: L8
Command: FEAT
Reply: 211-Features:
Reply: MFMT
Reply: LANG en-US.UTF-8*;en-US
Reply: SIZE
Reply: SITE MKDIR
Reply: MFF modify;UNIX.group;UNIX.mode;
Reply: REST STREAM
Reply: MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Reply: UTF8
Reply: EPRT
Reply: SITE SYMLINK
Reply: EPSV
Reply: SITE UTIME
Reply: MDTM
Reply: SITE RMDIR
Reply: TVFS
Reply: SITE COPY
Reply: 211 End
Command: PWD
Reply: 257 "/" is the current directory
Status: Current path is /
Command: TYPE I
Reply: 200 Type set to I
Command: PASV
Reply: 227 Entering Passive Mode (54,94,152,176,199,81).
Command: MLSD
Status: Data connection established.
[color=red]Error: Malformed directory listing
Error: Line feed received without preceding carriage return [/color]

No log do proftpd tenho essa mensagem

2015-07-26 20:23:00,151 servidor01 proftpd[1772] localhost (filezilla-project.org[213.239.212.239]): USER lya: Login successful.
2015-07-26 20:23:03,424 servidor01 proftpd[1772] localhost (filezilla-project.org[213.239.212.239]): ROOT PRIVS: unable to seteuid(): Operation not permitted
2015-07-26 20:23:03,424 servidor01 proftpd[1772] localhost (filezilla-project.org[213.239.212.239]): ROOT PRIVS: unable to setegid(): Operation not permitted
2015-07-26 20:23:03,427 servidor01 proftpd[1772] localhost (filezilla-project.org[213.239.212.239]): RELINQUISH PRIVS: unable to seteuid(PR_ROOT_UID): Operation not permitted
2015-07-26 20:23:03,427 servidor01 proftpd[1772] localhost (filezilla-project.org[213.239.212.239]): FTP session closed.


Instalei o proftpd usando
apt-get install proftpd-basic 


O usuario foi adicionado usando os comando:


cp /bin/false /bin/ftp
echo "/bin/ftp" >> /etc/shells
adduser --shell=/bin/ftp --home=/www/lya lya


Se eu executar ls -l na raiz:

drwxr-xr-x 6 ftp nogroup 4096 Jul 23 03:17 www


Se eu executar ls -l dentro de www

drwxr-xr-x 5 lya lya 4096 Jul 23 03:17 lya


Arquivo /etc/proftp/proftpd.conf

# /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 on
# If set on you can experience a longer connection delay in many cases.
IdentLookups off
ServerName "servidor01"
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 ~
<Global>
ServerIdent on "FTP Server ready."
</Global>

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

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

# 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
QuotaLog /etc/proftpd/quota_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 on

<IfModule mod_quotatab_file.c>
QuotaLimitTable file:/etc/proftpd/ftpquota.limittab #Abaixo como criar os arquivos.
QuotaTallyTable file:/etc/proftpd/ftpquota.tallytab
</IfModule>
</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>




Meu Security Group esta configurado assim:
SSH ; TCP 22 : 0.0.0.0/0
Custom; 2121; 0.0.0.0/0
HTTP; TCP 80; 0.0.0.0/0
DNS (UDP); UDP 53; 0.0.0.0/0
HTTPS; TCP 443; 0.0.0.0/0
DNS (TCP); TCP 53; 0.0.0.0/0
Custom; TCP 20 - 21 0.0.0.0/0
All ICMP; All; N/A; 0.0.0.0/0
Custom; TCP 49152 - 65534; 0.0.0.0/0


O que pode estar causando esse problema?



  


2. Re: Problemas para configurar um servidor FTP com o Proftpd

João Araújo
joaoAraujo

(usa openSUSE)

Enviado em 01/10/2015 - 18:41h

Cara abre o seu proftpd.conf e adiciona a linha abaixo, que é para o seu servidor aceita conexões externas
AllowForeignAddress on

Descomenta a linha abaixo
#RequireValidShell off

reinicia o proftpd e testa.






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts