Autor Tópico: proftpd dúvida  (Lida 6558 vezes)

Offline vinles

  • Usuário Ubuntu
  • *
  • Mensagens: 14
    • Ver perfil
proftpd dúvida
« Online: 04 de MAR?O de 2010, 08:18 »
Olá pessoal, montei um servidor de ftp, quando pesquisei tinha bastantes post refente ao proftpd acabei escolhendo esse servidor. Instalei configurei de acordo com tutorial, local roda lindamente porém quando vou rodar externamente só consegui até agora me conectar por esse site(http://www.net2ftp.com) um site de ftp online, porém pelo filezilla o fireFTP não consigo conectar de forma alguma.

O filezilla mostra essas mensagens quando vai conectar:

Citar
Estado:   A resolver o endereço de XXXXX.xxxx.org
Estado:   A conectar a 189.xxx.19.xxx:2121 ...
Estado:   conexão estabelecida, à espera da mensagem de boas-vindas ...
Resposta:   220 ProFTPD 1.3.2 Server ready.
Comando:   USER xxxxx
Resposta:   331 Password required for xxxxx
Comando:   PASS ******
Resposta:   230 User xxxxx logged in
Comando:   SYST
Resposta:   215 UNIX Type: L8
Comando:   FEAT
Resposta:   211-Features:
Resposta:    MDTM
Resposta:    MFMT
Resposta:    UTF8
Resposta:    MFF modify;UNIX.group;UNIX.mode;
Resposta:    MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
Resposta:    REST STREAM
Resposta:    LANG pt-BR.UTF-8*
Resposta:    SIZE
Resposta:   211 End
Comando:   OPTS UTF8 ON
Resposta:   200 UTF8 set to on
Estado:   Ligado
Estado:   A obter a lista de pastas ...
Comando:   PWD
Resposta:   257 "/" is the current directory
Comando:   TYPE I
Resposta:   200 Type set to I
Comando:   PASV
Resposta:   227 Entering Passive Mode (192,168,1,10,129,149).
Estado:   O servidor enviou uma resposta passiva com um endereço indeterminável. A usar, ao invés, o endereço do servidor.
Comando:   MLSD

Não sei o que pode ser vou postar parte da minha configuração do proftpd:

Código: [Selecionar]
#
# /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
# If set on you can experience a n

IdentLookups on

ServerName "xxxx server"
ServerType standalone
DeferWelcome on

MultilineRFC2228                  on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 2200
TimeoutStalled 2200
TimeoutIdle         2200

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

DenyFilter \*.*/

# Use this to jail all users in their homes
DefaultRoot /tcc

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

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

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



Espero que alguem possa me ajudar, estou montando esse ftp para meu tcc.

Offline vinles

  • Usuário Ubuntu
  • *
  • Mensagens: 14
    • Ver perfil
Re: proftpd dúvida
« Resposta #1 Online: 21 de MAR?O de 2010, 00:11 »
Bom pessoal depois de um tempo consegui resolver o problema de conexão externa:
Aqui em casa tenho um roteador por taz e liberto só as portas necessárias, porém ao começar ler sobre ftp descobri o problema:

O ftp ele usa a porta 21 apenas para receber sinal de conexão porém para enviar para o usuário que está conectando ele usa uma outra porta com isso não dava certo afinal as outras portas estão bloqueadas.

O FTP trabalha de duas formas:

Modo normal

Na hora de transmitir os dados ele escolhe uma porta randomica para enviar os dados e avisa o cliente qual porta usar.

Modo passivo(passive mode)

O servidor usa um range de portas especificado nas configurações do ftp para enviar os dados e avisa o cliente qual porta usar.
Com isso é só você colocar um range de sua escolha nas configurações e liberar essas portas, como no meu caso são pocas pessoas que vão usar eu abri um range de 10 portas só e resolvi o problema.

Para colocar o proftpd em passive mode deve falar pra ele qual seu ip externo, no meu caso eu tenho um dns do no-ip
Código: [Selecionar]
MasqueradeAddress ip ou dnsexemplo:
Código: [Selecionar]
MasqueradeAddress seudominio.no-ip.org
Agora precisa falar qual range de portas ele deve usar
Código: [Selecionar]
PassivePorts valor_inicial valor_final
Exemplo
Código: [Selecionar]
PassivePorts 65800 65820
E na hora de conectar deve marcar o passive mode no cliente ftp.

Leia mais em:
http://www.guiadohardware.net/termos/passive-mode
http://www.proftpd.org/docs/howto/NAT.html



Agora o problema é outro, não consigo conectar localmente alguem sabe como resolver esse outro problema?

GRATO