{"id":582,"date":"2010-09-20T09:37:34","date_gmt":"2010-09-20T14:37:34","guid":{"rendered":"http:\/\/it.thelibrarie.com\/weblog\/?p=582"},"modified":"2012-07-24T11:01:23","modified_gmt":"2012-07-24T16:01:23","slug":"vsftp-ssl-and-filezilla","status":"publish","type":"post","link":"https:\/\/it.thelibrarie.com\/weblog\/2010\/09\/vsftp-ssl-and-filezilla\/","title":{"rendered":"VSFTP SSL and Filezilla"},"content":{"rendered":"<p>FTP Server needed to be secure (at least SSL 128) and was running on Ubuntu 10.04.1 x32.  FTP client was required to be platform independent but needed to be tested on Windows 7 and Windows XP.  I decided to use Filezilla for various reasons.<\/p>\n<p>The easiest step was setting up the FTP server on the Ubuntu box.  I followed along a bit on &#8220;Mike&#8217;s&#8221; blog (http:\/\/beginlinux.com\/blog\/2009\/10\/ubuntu-9-10-secure-ftp-with-ssl\/).  I was logged in as root to avoid all those sudo&#8217;s.<\/p>\n<p><strong>Update the system and install VSFTPD:<\/strong><br \/>\n<code>apt-get update<\/code><br \/>\n<code>apt-get upgrade<\/code><br \/>\n<code>apt-get install vsftpd<\/code><\/p>\n<p><strong>Edit the VSDTPD configuration:<\/strong><br \/>\n<code>nano \/etc\/vsftpd.conf<\/code><\/p>\n<blockquote><p># Example config file \/etc\/vsftpd.conf<br \/>\n## Base Configuration<br \/>\nlisten=YES<br \/>\n#listen_ipv6=YES<br \/>\n#anonymous_enable=YES<br \/>\nlocal_enable=YES<br \/>\nwrite_enable=YES<br \/>\n#local_umask=022<br \/>\n#anon_upload_enable=YES<br \/>\n#anon_mkdir_write_enable=YES<br \/>\ndirmessage_enable=YES<br \/>\nuse_localtime=YES<br \/>\nxferlog_enable=YES<br \/>\nconnect_from_port_20=YES<\/p>\n<p>## Permissions<br \/>\n#chown_uploads=YES<br \/>\n#chown_username=whoever<br \/>\nchroot_local_user=YES<br \/>\nchroot_list_enable=NO<br \/>\nsecure_chroot_dir=\/var\/run\/vsftpd\/empty<br \/>\npam_service_name=vsftpd<\/p>\n<p>## SSL Certificate Configuration<br \/>\n#implicit_ssl=YES<br \/>\nssl_enable=YES<br \/>\nrsa_cert_file=\/etc\/ssl\/certs\/vsftpd.pem<br \/>\nrsa_private_key_file=\/etc\/ssl\/certs\/vsftpd.pem<br \/>\nallow_anon_ssl=NO<br \/>\nssl_tlsv1=YES<br \/>\n#ssl_sslv2=YES<br \/>\nssl_ciphers=HIGH<br \/>\nssl_sslv3=YES<br \/>\nrequire_ssl_reuse=NO<\/p>\n<p>## Force encrypted login\/passwords<br \/>\nforce_local_data_ssl=YES<br \/>\nforce_local_logins_ssl=YES<br \/>\nlisten_port=990<br \/>\nforce_dot_files=NO<br \/>\ntcp_wrappers=NO<br \/>\n#listen_address=<br \/>\n#hide_file=<br \/>\n#anon_max_rate=<br \/>\n#local_max_rate=<br \/>\npasv_min_port=6000<br \/>\npasv_max_port=6500<br \/>\n#pasv_address=IPOFSERVER\n<\/p><\/blockquote>\n<p><code>Save and exit.<\/code><\/p>\n<p><strong>Create the self-signed SSL certificate.<\/strong>  I&#8217;m assuming you&#8217;re like me and don&#8217;t have a budget for miscellaneous SSL certificates.<br \/>\n<code>openssl req -x509 -nodes -days 730 -newkey rsa:2048 -keyout \/etc\/ssl\/certs\/vsftpd.pem -out \/etc\/ssl\/certs\/vsftpd.pem<\/code><br \/>\nEnter your information when prompted.<\/p>\n<p><strong>Restart the VSFTPD server:<\/strong><br \/>\n\/etc\/init.d\/vsftpd restart<\/p>\n<p><strong>Open ports on your firewall\/router\/gateway.<\/strong>  Obviously change these to whatever you require and have in your conf file.<br \/>\n<code>TCP 20-21 (data and login)<\/code><br \/>\n<code>TCP 6000-6500 (PASV ports)<\/code><\/p>\n<p><strong>Connect using FileZilla:<\/strong><br \/>\nUsing the SiteManager (quick connect won&#8217;t work in this case), enter in the following:<br \/>\n<code>Host - your IP address of the server (you can use the local IP for testing functionality of the server, but use the public IP for testing the firewall rules)<\/code><br \/>\n<code>Port - 990<\/code><br \/>\n<code>Server type - FTPES (FTP over explicit TLS\/SSL)<\/code><br \/>\n<code>Logon Type - Normal<\/code><br \/>\n<code>User - username on the system<\/code><br \/>\n<code>Password - password for that user<\/code><br \/>\nClick connect!  Everything should work.<\/p>\n<p>PS, this was done on a fresh install of ubuntu with SSH and LAMP installed.<\/p>\n<p>***EDIT***<br \/>\nI was looking through the logs (\/var\/log\/vsftpd.log) and watching connections:<br \/>\n<code>watch cat \/var\/log\/vsftpd.log<\/code><br \/>\nWhen I noticed the following:<\/p>\n<blockquote><p>No SSL session reuse on data channel<\/p><\/blockquote>\n<p>I added &#8220;require_ssl_reuse=NO&#8221; to the vsconfig<\/p>\n<blockquote><p><code>nano \/etc\/vsftp.conf<\/code><br \/>\n<code>require_ssl_reuse=NO<\/code><br \/>\nSave and exit<br \/>\n<code>\/etc\/init.d\/vsftpd restart<\/code><\/p><\/blockquote>\n<p>Now I&#8217;m getting:<\/p>\n<blockquote><p>Connection terminated without SSL shutdown &#8211; buggy client?<\/p><\/blockquote>\n<p>If you&#8217;re receiving complaints that some cannot perform a directory listing, or you dislike having the following errors in your logs:<br \/>\n<code>Server sent passive reply with unroutable address. Using server address instead.<\/code><br \/>\n<code>GnuTLS error -53: Error in the push function.<\/code><br \/>\nAdd the following to your NAT&#8217;d device (ie firewall\/router):<br \/>\n<code>nano \/etc\/vsftpd.conf<\/code><br \/>\n<code>pasv_address=IPADDRESSOFYOUREXTERNALNAT<\/code><br \/>\nSave and restart the vsftp server<br \/>\n<code>\/etc\/init.d\/vsftpd restart<\/code><\/p>\n<p>Edited to include pasv issue, remove sslv2, change the cert to 2048bit and valid for 2 years.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FTP Server needed to be secure (at least SSL 128) and was running on Ubuntu 10.04.1 x32. FTP client was required to be platform independent but needed to be tested on Windows 7 and Windows XP. I decided to use Filezilla for various reasons. The easiest step was setting up the FTP server on the &hellip; <a href=\"https:\/\/it.thelibrarie.com\/weblog\/2010\/09\/vsftp-ssl-and-filezilla\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">VSFTP SSL and Filezilla<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8],"tags":[],"class_list":["post-582","post","type-post","status-publish","format-standard","hentry","category-linux","category-microsoft"],"_links":{"self":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/comments?post=582"}],"version-history":[{"count":8,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":1000,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/posts\/582\/revisions\/1000"}],"wp:attachment":[{"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/media?parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/categories?post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.thelibrarie.com\/weblog\/wp-json\/wp\/v2\/tags?post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}