{"id":2758,"date":"2016-10-12T20:48:53","date_gmt":"2016-10-12T18:48:53","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=2758"},"modified":"2016-10-12T20:58:01","modified_gmt":"2016-10-12T18:58:01","slug":"how-to-configure-pureftpd-to-accept-tls-sessions-on-debian","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=2758","title":{"rendered":"How To Configure PureFTPd To Accept TLS Sessions On Debian"},"content":{"rendered":"<p>FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. This article explains how to configure PureFTPd to accept TLS sessions on a Debian Lenny server.<\/p>\n<h3 id=\"-installing-openssl\">1 Installing OpenSSL<\/h3>\n<p>OpenSSL is needed by TLS; to install OpenSSL, we simply run (verify version or if installed \/ <strong>openssl version<\/strong>) :<\/p>\n<pre>aptitude install openssl<\/pre>\n<h3 id=\"-configuring-pureftpd\">2 Configuring PureFTPd<\/h3>\n<p>If you want to allow FTP <b>and<\/b> TLS sessions, run<\/p>\n<pre>echo 1 &gt; \/etc\/pure-ftpd\/conf\/TLS<\/pre>\n<p>If you want to accept TLS sessions only (no FTP), run<\/p>\n<pre>echo 2 &gt; \/etc\/pure-ftpd\/conf\/TLS<\/pre>\n<p>instead.<\/p>\n<p>To not allow TLS at all (only FTP), either delete \/etc\/pure-ftpd\/conf\/TLS or run<\/p>\n<pre>echo 0 &gt; \/etc\/pure-ftpd\/conf\/TLS<\/pre>\n<p>&nbsp;<\/p>\n<h3 id=\"-creating-the-ssl-certificate-for-tls\">3 Creating The SSL Certificate For TLS<\/h3>\n<p>In order to use TLS, we must create an SSL certificate. I create it in \/etc\/ssl\/private\/, therefore I create that directory first:<\/p>\n<pre> mkdir -p \/etc\/ssl\/private\/<\/pre>\n<p>Afterwards, we can generate the SSL certificate as follows:<\/p>\n<pre>openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/pure-ftpd.pem -out \/etc\/ssl\/private\/pure-ftpd.pem<\/pre>\n<p>Country Name (2 letter code) [AU]: &lt;&#8211; Enter your Country Name (e.g., &#8220;DE&#8221;).<br \/>\nState or Province Name (full name) [Some-State]:&lt;&#8211; Enter your State or Province Name.<br \/>\nLocality Name (eg, city) []:&lt;&#8211; Enter your City.<br \/>\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:&lt;&#8211; Enter your Organization Name (e.g., the name of your company).<br \/>\nOrganizational Unit Name (eg, section) []:&lt;&#8211; Enter your Organizational Unit Name (e.g. &#8220;IT Department&#8221;).<br \/>\nCommon Name (eg, YOUR name) []:&lt;&#8211; Enter the Fully Qualified Domain Name of the system (e.g. &#8220;server1.example.com&#8221;).<br \/>\nEmail Address []:&lt;&#8211; Enter your Email Address.<\/p>\n<p>Change the permissions of the SSL certificate:<\/p>\n<pre>chmod 600 \/etc\/ssl\/private\/pure-ftpd.pem<\/pre>\n<p>Finally restart PureFTPd:<\/p>\n<pre>\/etc\/init.d\/pure-ftpd-mysql restart<\/pre>\n<p>That&#8217;s it. You can now try to connect using your FTP client; however, you should configure your FTP client to use TLS\/SSL explicit encryption.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FTP is a very insecure protocol because all passwords and all data are transferred in clear text. By using TLS, the whole communication can be encrypted, thus making FTP much more secure. This article&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2843,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[34,14],"tags":[],"youtube_video":null,"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/2758"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2758"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/2758\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2843"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}