Passo 1:
sudo apt-get install proftpd
Passo 2:
Adicione a linha abaixo no arquivo /etc/shells
/bin/false
Passo 3:
Crie o diretório /home/FTP-shared
cd /home
sudo mkdir FTP-shared
Passo 4:
Agora vamos criar um usuário para ter acesso a este FTP com o comando abaixo, o padrão está userftp, mas pode ser modificado para um de sua preferência
sudo useradd userftp -p sua_senha_aqui -d /home/FTP-shared -s /bin/false
Passo 5:
cd /home/FTP-shared/
sudo mkdir download
sudo mkdir upload
Passo 6:
Agora é bom setar as permissões dos diretórios como abaixo:
cd /home
sudo chmod 755 FTP-shared
cd FTP-shared
sudo chmod 755 download
sudo chmod 777 upload
Passo 7:
Vamos editar o arquivo do nosso FTP:
sudo gedit /etc/proftpd/proftpd.conf
Passo 8:
No arquivo proftpd.conf compie e cole o o que está abaixo, leia os comentários e faça as alterações que você achar necessário, como nome de usuário, nome do servidor e porta.
# To really apply changes reload proftpd after modifications.
# Manual traduzido por André Gondim
AllowOverwrite on
AuthAliasOnly on
# Choose here the user alias you want !!!!
# AQUI TEM OS ÁLIAS CASO DESEJE ADICIONE O USUÁRIO QUE VOCE CRIOU
UserAlias sauron userftp
#Mude o nome do servidor ChezFrodon para um da sua escolha
ServerName "ChezFrodon"
ServerType standalone
DeferWelcome on
MultilineRFC2228 on
DefaultServer on
ShowSymlinks off
TimeoutNoTransfer 600
TimeoutStalled 100
TimeoutIdle 2200
DisplayFirstChdir .message
ListOptions "-l"
RequireValidShell off
TimeoutLogin 20
RootLogin off
# It's better for debug to create log files
ExtendedLog /var/log/ftp.log
TransferLog /var/log/xferlog
SystemLog /var/log/syslog.log
#DenyFilter *.*/
# I don’t choose to use /etc/ftpusers file (set inside the users you want to ban, not useful for me)
UseFtpUsers off
# Allow to restart a download
AllowStoreRestart on
# Port 21 is the standard FTP port, so don’t use it for security reasons (choose here the port you want)
# AQUI A PORTA ESTÁ ALTERADA PARA FUNCIONAR NA PADRAO BOTE 21
Port 1980
# 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 nobody
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
PersistentPasswd off
MaxClients 8
MaxClientsPerHost 8
MaxClientsPerUser 8
MaxHostsPerUser 8
# Display a message after a successful login
AccessGrantMsg “welcome !!!”
# This message is displayed for each access good or not
ServerIdent on “you’re at home”
# Set /home/FTP-shared directory as home directory
DefaultRoot /home/FTP-shared
# Lock all the users in home directory, ***** really important *****
DefaultRoot ~
MaxLoginAttempts 5
#VALID LOGINS
#AQUI NO AllowUser SE VOCE MUDOU O NOME DO USUARIO DO FTP MUDA AQUI TAMBEM
<Limit LOGIN>
AllowUser userftp
DenyALL
</Limit>
<Directory /home/FTP-shared>
Umask 022 022
AllowOverwrite off
<Limit MKD STOR DELE XMKD RNRF RNTO RMD XRMD>
DenyAll
</Limit>
</Directory>
<Directory /home/FTP-shared/download/*>
Umask 022 022
AllowOverwrite off
<Limit MKD STOR DELE XMKD RNEF RNTO RMD XRMD>
DenyAll
</Limit>
</Directory>
<Directory> /home/FTP-shared/upload/>
Umask 022 022
AllowOverwrite on
<Limit READ RMD DELE>
DenyAll
</Limit>
<Limit STOR CWD MKD>
AllowAll
</Limit>
</Directory>
Passo 9:
Para iniciar,parar ou reiniciar o FTP faça:
sudo /etc/init.d/proftpd start
sudo /etc/init.d/proftpd stop
sudo /etc/init.d/proftpd restart
Passo 10:
Para verificar se está tudo correto faça:
sudo proftpd -td5
Conclusão:
No exemplo desse servidor foi criado um servidor FTP com o usuário: userftp, a senha que você escolheu, e caso você não tenha mudado a porta ele está na porta 1980.
Mais Informações acesse : Aqui
Nenhum comentário:
Postar um comentário