Use OpenSSL in Linux to create a secure vsftp

Source: Internet
Author: User


Vsftpd is one of the FTP server software on Linux. It supports many options, one of which allows OpenSSL to encrypt data, to some extent, this can make up for the defects of the inscription transmitted when ftp transfers the account password information, which can make the FTP account more secure.

1. First, install vsftpd

# yum install vsftpd

2. Create a ca

# Cd/etc/pki/CA # mkdir certs newcerts CRL # Touch index.txt serial # echo 01> serial # Vim/etc/pki/tls/OpenSSL. conf # modify the following fields, in this way, it is convenient to issue a certificate [ca_default] dir =/etc/pki/CA # specify the CA path [req_distinguished_name] countryname_default = cn # default country name stateorprovincename_default = HN # province localityname _ # Region 0. organizationname_default = rhce # company name # OpenSSL genrsa 1024> private/cakey. PEM # OpenSSL req-ne W X509-key private/cakey. pem-out cacert. pem Press enter. Be sure to configure the domain name! Chmod 600 private/cakey. pem cacert. pem has been created for the CA certificate.

3. issue a certificate to vsftpd

# Cd/etc/vsftpd/# mkdir SSL # OpenSSL genrsa 1024> SSL/FTP. key # OpenSSL req-New-key SSL/FTP. key-out SSL/FTP. REQ is another carriage return, vsfptd request certificate application number # OpenSSL ca-in SSL/FTP. REQ-out SSL/FTP. CRT confirm signing # rm SSL/FTP. REQ-F # chmod 600 SSL/FTP. *

4. Edit the configuration file and add the following lines:

# Vim/etc/vsftpd. add the following line to the conf: # SSL configuressl_enable = yesssl_tlsv1 = Yes // we recommend that you enable this line. ssl_sslv2 = nossl_sslv3 = noallow_anon_ssl = Yes // enable Anonymous users to use authorization = Yes // use encrypted force_local_logins_ssl = Yes // sslrsa_cert_file =/etc/vsftpd/SSL/FTP for forced logon. CRT rsa_private_key_file =/etc/vsftpd/SSL/FTP. key

5. Enable the vsftpd service and use SSL encryption to access FTP on the client.
# Service vsftpd start

6. Run the command to capture packets on the server to check whether the data is encrypted.
# Tcpdump-I eth0-A DST 192.168.0.48

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.