Форум русскоязычного сообщества Ubuntu


Следите за новостями русскоязычного сообщества Ubuntu в Twitter-ленте @ubuntu_ru_loco

Автор Тема: Настройка MOD_TLS в ProFTPd на Ubuntu 6.06  (Прочитано 2601 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн crapaud

  • Автор темы
  • Новичок
  • *
  • Сообщений: 2
    • Просмотр профиля
Уважаемые форумчане. Я относительно слабо разбираюсь в Linuxе, и многочисленных он не внятных FAQах, разбросанных по сети... поэтому и возник такой вопрос.

Есть сервак на Ubuntu 6.06 На нем стоит LAMP, OpenSSL, ProFTPd, SSH. Все это настоено и пашет, многое, благодаря местным форумчанам (за что глубокий респект :) ). Но захотелось закачивать и скачивать на сервер контент через полностью защищенное TLS соединение. Решил настроить. нарыл несколько ссылок:

_http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-TLS.html
_http://www.castaglia.org/proftpd/modules/mod_tls.html#TLSCACertificateFile

но запутался на теме создания сертификатов. я так понял, надо сделать ключ и самоподписанный сертификат, но что-то нифига не выходит.

Если кто-нибудь уже делал такое - поделитесь, желательно пошагово  для тупых

Оффлайн crapaud

  • Автор темы
  • Новичок
  • *
  • Сообщений: 2
    • Просмотр профиля
Re: Настройка MOD_TLS в ProFTPd на Ubuntu 6.06
« Ответ #1 : 14 Мая 2007, 11:32:04 »
Нда... что-то не густо ответов... Нашел на англоязычном форуме следующую информацию:
Цитировать
1- Enable TLS/SSL encryption (FTPS)
The FTP file sharing protocol is an old protocol which was created when internet was still a secure place, therefore the default FTP protocol is not that secure.
For example the password and username for login are transmitted in plain text which obviously isn't secure.
That why, to fit the needs of our generation, encryption solutions were developed and one of them is TLS/SSH encryption.
This will encrypt the username and password and all the data you send, obviously to use it the FTP client must support SFTP protocol.

here are the steps to enable TLS/SSH encryption (FTPS):

Paste these commands in a terminal :
Code:
Цитировать
sudo apt-get install build-essential
sudo apt-get install libssl-dev
cd /etc
sudo mkdir ftpcert
cd ftpcert/
sudo openssl genrsa -des3 -out server.key 1024
sudo openssl req -new -key server.key -out server.csr
sudo openssl genrsa -des3 -out ca.key 1024
sudo openssl req -new -x509 -days 365 -key ca.key -out ca.crt
sudo wget http://frodubuntu.free.fr/ubuntu/sign.sh
sudo chmod +x sign.sh
sudo ./sign.sh server.csr
Then add this section to yout proftpd.conf file :
Code:
Цитировать
<IfModule mod_tls.c>
    TLSEngine on
    TLSLog /var/ftpd/tls.log
    TLSProtocol TLSv1

    # Are clients required to use FTP over TLS when talking to this server?
    TLSRequired off

    # Server's certificate
    TLSRSACertificateFile /etc/ftpcert/server.crt
    TLSRSACertificateKeyFile /etc/ftpcert/server.key

    # CA the server trusts
    TLSCACertificateFile /etc/ftpcert/ca.crt

    # Authenticate clients that want to use FTP over TLS?
    TLSVerifyClient off
</IfModule>
If you use edgy or proftpd 1.3 in general add this line at the beginning of your proftpd.conf file, it will load all the extra modules like mod_tls.c :
Code:
Цитировать
Include /etc/proftpd/modules.conf
Note - Use TLSRequired ON to force the use of TLS. OFF means that the use of TLS is optional.

Optional step:

You will notice that you will be asked for the password you set for the server.key file each time you start/stop/restart the server, it is because the RSA private key is encrypted in the server.key file.
The solution is to remove the encryption of the RSA private key but it makes the key readable in the server.key file which is obviously less secure, anyway if you do that make sure that the server.key is readable only by root.
Once you know that it's less secure here are the command lines to remove the encryption of the RSA private key :
Code:
Цитировать
cd /etc/ftpcert
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
Here are some links to read in case of problems or just to get more informations :

http://www.modssl.org/docs/2.7/ssl_faq.html#cert-ownca
http://www.castaglia.org/proftpd/doc...HOWTO-TLS.html

Thanks to nix4me for the help he provided and for the instructions.

Оригинал лежит тут:http://ubuntuforums.org/showthread.php?t=79588

Вобщем-то вроде бы как сертификаты сгенерились, сервер заработал... но! По TLS соединения нет, сервак жутко тормозит.. В tls.log следующая фраза:
Цитировать
mod_tls/2.1.1[15712]: ssl/tls required but absent on control channel, denying USER command
так что будем копать дальше...

Такие простынки цитат лучше приаттачивать.
С уважением, Switcher
« Последнее редактирование: 14 Мая 2007, 11:37:03 от Switcher »

 

Страница сгенерирована за 0.018 секунд. Запросов: 20.