#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
    ,o888b,`?88888--*-#####**************#####-*--88888P',d888o,
  ,8888 888   ?888          Eliel Vieira          888P   888 8888,
  8888888P'    888     Niteroi - RJ - 07/2004     888    `?8888888
  888P'        888      elielvieira@gmail.com     888        `?888
  `88   O     d888    http://elielvieira.go.to    888b     O  88/'
    `?._  _.o88888--*-#####**************#####-*--88888o._  _.P'
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#


 ###mnq#38##ll######mnq#38##ll######mnq#38##ll######mnq#38##ll### 

     Como Instalar, Ativar e usar o Servico FTP e TELNET: 

 ###mnq#38##ll######mnq#38##ll######mnq#38##ll######mnq#38##ll### 

1 - Instalacao:
[root@localhost]# rpm -hiv telnet*
[root@localhost]# rpm -hiv ftp*
[root@localhost]# rpm -hiv proftpd*

2 - Editar o arquivo inetd.conf 
[root@localhost]# vi /etc/inetd.conf 

3 - Verifique se existem as seguintes linhas: Caso elas estejam 
comentadas apenas remova o "#". 
ftp stream tcp nowait root /usr/sbin/tcpd in.ftpd -l -a 
telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd 

4 - Caso esteja utilizando o proftpd a linha deve ser essa: 
ftp stream tcp nowait root /usr/sbin/tcpd in.proftpd 

5 - Verifique se no ntstys o inet est selecionado para inicializacao. 
[root@localhost]# ntsysv 

6 - Configuracao padrao do arquivo proftpd.conf:

[root@localhost]# vi proftpd.conf

# ProFTPD Configuration 
# 
# Configurao do ProFTPD 
# 
ServerName         "FTP - Instalao Default" 
ServerType         standalone 
DefaultServer      on 
ScoreboardPath     /var/run 
DeferWelcome       on 
ServerAdmin        root@localhost 
SyslogFacility     AUTH 
Serverident        on "Bem-Vindo ao Servidor de FTP" 

# Port 21 (ftp standard) is used in case of standalone more 
# 
# Utiliza-se o port 21 (padro ftp) no caso de funcionamento standalone 
# 
Port            21 

# Umask 022 is a good default value to prevent new directories and 
# files from being writable by the group or by other users 
# 
# Umask 022  um bom padro para prevenir que novos diretrios e 
# arquivos sejam gravveis pelo grupo ou outros usurios 
# 
Umask            022 

# To prevent DoS attacks, the max number of instances is limited to 30. 
# If one wants to allow more then 30 simultaneous connectionva, just 
# increment this value. This directive only applies if running in standalone 
# mode 
# 
# Para previnir ataques do tipo DoS, limita-se o numero de instncias  
# 30. Caso se queira permitir mais de 30 conexes simultneas, simplesmente 
# aumenta-se este valor. Esta diretiva s se aplica ao funcionamento 
# standalone 
MaxInstances         30 

# 
# This option, if enabled, will make the users unable to access anything 
# outside their home directory tree. READ THE DOCS! 
# 
# Esta opo, se habilitada, faz com que os usurios no consegam acessar nada 
# fora da sua arvore do diretrio home. LEIA A DOCUMENTAO! 
# 
DefaultRoot ~   

# User and Group the server will run as 
# 
# Usurio e grupo para o servidor 
# 
User            nobody 
Group            nobody 

<Directory /*> 
  AllowOverwrite      no 
</Directory> 

# Default configuration for anonymous ftp, without an incoming directory. 
# To activate, just uncomment it. 
# 
# Configurao bsica para ftp annimo, sem diretrio para recepo 
# de arquivos 
# Para ativar, descomentar. 
# 
#<Anonymous /var/ftp/default> 
#  User            ftp 
#  Group            ftp 
#  DirFakeUser         on 
#  DirFakeGroup         on 
# 
## 
## This option will enable the ftp user without it having to have it's shell 
## listed on the /etc/shells file 
## 
## Esta opo habilita o usurio ftp sem que mesmo precise ter sua shell listada 
## no arquivo /etc/shells 
## 
#  RequireValidShell      off 
# 
#  # ftp = anonymous 
#  UserAlias         anonymous ftp 
# 
#  # max anonymous logins at one time. 
#  # Uncomment one. 
#  # 
#  # nmero mximo de logins annimos 
#  # Descomente um. 
#  MaxClients         10 "Nmero mximo de clientes, tente mais tarde." 
#  MaxClients         10 "No more clients allowed at this time. Try again latter." 
# 
#  # No more then 2 connections per client 
#  # Uncomment one. 
#  # 
#  # No mximo duas conexes por cliente 
#  # Descomente um. 
#  MaxClientsPerHost      2 "Voc j est com muitas conexes simultneas." 
#  MaxClientsPerHost      2 "Too many simultaneous connections from your host." 
# 
#  # welcome.msg is showed uppong connetiona, and .message at each directory 
#  # accessed 
#  # 
#  # welcome.msg mostrado na conexo e .message mostrado para cada 
#  # diretrio acessado. 
#  # 
#  DisplayLogin         welcome.msg 
#  DisplayFirstChdir      .message 
#  AccessGrantMsg      "Acesso annimo aceito para %u." 
#  AccessGrantMsg      "Anonymous access granted for %u." 
# 
#  # Write is denied on the anonymous chroot 
#  # 
#  # Limite gravao no chroot annimo 
#  # 
#  <Limit WRITE> 
#    DenyAll 
#  </Limit> 
# 
#</Anonymous> 

ESC:wq

7 - Iniciar o servico FTP
[root@localhost]# service proftpd status
[root@localhost]# service proftpd stop
[root@localhost]# service proftpd start
 
8 - Para ativar e validar as mudanas do arquivo conf: 
[root@localhost]# /etc/rc.d/init.d/inet status
[root@localhost]# /etc/rc.d/init.d/inet stop 
[root@lcoalhost]# /etc/rc.d/init.d/inet start 
ou 
[root@localhost]# service inet stop 
[root@lcoalhost]# service inet start 

P R O N T O    J A    E S T A    F U N C I O N A N D O !!!

9 - Cadastrando usuario eliel (como root):
[root@localhost]# adduser eliel
[root@localhost]# passwd eliel

10 - Utilizando o ftp apartir de uma maquina client: logar com usuario eliel
[eliel@localhost]# ftp 192.168.1.1

Obs.: Digite o login do usuario eliel e sua password.
      192.168.1.1  o servidor onde vc configurou o ftp,
      e tem o usuario eliel cadastrado.

11 - Utilizando o telnet apartir de um client:
[eliel@localhost]# telnet 192.168.1.1

12 - Dicas: 
[eliel@localhost]# cat ftpusers
[eliel@localhost]# cat ftpaccess


#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
    ,o888b,`?88888--*-#####**************#####-*--88888P',d888o,
  ,8888 888   ?888          Eliel Vieira          888P   888 8888,
  8888888P'    888     Niteroi - RJ - 07/2004     888    `?8888888
  888P'        888      elielvieira@gmail.com     888        `?888
  `88   O     d888    http://elielvieira.go.to    888b     O  88/'
    `?._  _.o88888--*-#####**************#####-*--88888o._  _.P'
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
#***##rmldrsdlvrvr###rmldrsdlvrvr##rmldrsdlvrvr###rmldrsdlvrvr##***#
