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 # yuminstallvsftpd2. create CA # cdetcpki

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, installFtpD

# Yum install vsftpd

2. Create a CA

  1. #Cd/Etc/pki/CA
  2. #MkdirCerts neWcErts crl
  3. #TouchIndEx. Txt serial
  4. # Echo 01>Serial
  5. # Vim/etc/pki/tLs/Openssl. conf # modify the following fields so that it is convenient to issue a certificate
  6. [CA_default]
  7. Dir=/Etc/pki/CA # specify the CA path
  8. [Req_distinguishEd_ Name]
  9. CounTrYName_default=CN# Default country name
  10. StatEOrProviNcEName_default=HN# Province
  11. LocalityName_default=ZZ# Region
  12. 0. organizationName_default=RHCE# Company name
  13. # Openssl genrsa 1024>Private/cakey. pem
  14. # Openssl req-new x509-key private/cakey. pem-out cacert. pem
  15. Press enter. Be sure to configure the domain name! The CA certificate has been created.
  16. Chmod600 private/cakey. pem cacert. pem

3. issue a certificate to vsftpd

  1. # Cd/etc/vsftpd/
  2. # Mkdir ssl
  3. # Openssl genrsa 1024> ssl/ftp. key
  4. # Openssl req-new-key ssl/ftp. key-out ssl/ftp. req
  5. Another carriage return, vsfptd's request certificate application number
  6. # Openssl ca-in ssl/ftp. req-out ssl/ftp. crt
  7. Confirm signing
  8. #RmSsl/ftp. req-f
  9. # Chmod 600 ssl/ftp .*

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

  1. # Vim/etc/vsftpd. conf
  2. Add the following lines
  3. # SSL configure
  4. Ssl _Enable= YES
  5. Ssl_tlsv1 = YES// We recommend that you enable this function.
  6. Ssl_sslv2 = NO
  7. Ssl_sslv3 = NO
  8. Allow_anon_ssl = YES// Enable ssl for anonymous users
  9. Force_local_data_ssl = YES// Use encryption for forced Data Transmission
  10. Force_local_logins_ssl = YES// Use ssl for forced Logon
  11. Rsa_cert _File=/Etc/vsftpd/ssl/ftp. crt
  12. 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. We useCommandPacket CaptureTo see if the data is encrypted.

# TCpDuMp-I eth0-A dst 192.168.0.48

Related Article

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.