Limited time promo

How to generate a self signed certificate

English en

This article applies only to Backup4all. If you don't have it yet, you must download it first.

Download now Buy licenses
Feb 17, 2022


We strive to keep our articles as accurate as possible. If you notice any inconsistencies or outdated info please let us know.
This article explains how to generate a self signed certificate. A self-signed certificate is an identity certificate signed by its own creator. That is, the person that created the certificate also signed off on its legitimacy.
In typical public key infrastructure (PKI) arrangements, a valid public key certificate is validated (i.e., contains correct information) by a digital signature from a certificate authority (CA). Users, or their software on their behalf, check that the private key used to sign some certificate matches the public key in the CA's certificate. Since CA certificates are often signed by other, "higher ranking," CAs, there must necessarily be a highest CA, which provides the ultimate in attestation authority in that particular PKI scheme.

Create a self signed certificate

  • Create a new file called "makecertopenssl.bat" with the following content:
    openssl genrsa -out b4a_root.key 2048
    openssl req -new -x509 -days 1826 -key b4aroot.key -out b4aroot.crt -subj /C=RO/ST=CLUJ/L=CLUJ-NAPOCA/O=Softland/OU=Backup4all/CN=Backup4all_ROOT
    :: create auth certificate request
    openssl genrsa -out b4a_sftp.key 2048
    openssl req -new -key b4asftp.key -out b4asftp.csr -config mycertcfg.cnf -subj /C=RO/ST=CLUJ/L=CLUJ-NAPOCA/O=Softland/OU=Backup4all/CN=Backup4all_SFTP
    :: create certificates
    openssl x509 -req -days 730 -in b4asftp.csr -CA b4aroot.crt -CAkey b4aroot.key -setserial 01 -out b4a_sftp.crt
    :: export certificates
    openssl pkcs12 -export -out b4acertifs.p12 -inkey b4asftp.key -in b4asftp.crt -chain -CAfile b4aroot.crt*
  1. Create another file called "mycertcfg.cnf" with the following content. Put both files in a new folder on your computer.
    default_bits = 4096
    distinguishedname = reqdistinguished_name
    reqextensions = reqext*

    countryName = Country Name (2 letter code)
    countryName_default = RO
    stateOrProvinceName = State or Province Name (full name)
    stateOrProvinceName_default = Cluj
    localityName = Locality Name (eg, city)
    localityName_default = Cluj-Napoca
    organizationName = Organization Name (eg, company)
    organizationName_default = Softland
    commonName = Common Name (e.g. server FQDN or YOUR name)
    commonName_max = 64
    commonNamedefault = Backup4allsftp*

    keyUsage=digitalSignature, keyEncipherment*
  2. Download OpenSSL from: https://slproweb.com/products/Win32OpenSSL.html
  3. Install it in: "C:\OpenSSL-Win64" folder
  4. Open Command Prompt and run this command: set path=%path%;C:\OpenSSL-Win64\bin
  5. In Command Prompt run "makecertopenssl.bat" file. Some new files will be created in "C:\OpenSSL-Win64"
  6. Run the "b4a_certifs.p12" file, to install the certificate. Make sure you select the option to have this certificate exportable.
  7. Open Backup4all and create a new backup job using SFTP destination. Press Advanced mode button.
  8. On SFTP configuration page, configure the SFTP server.
  9. Select Personal certificate store option and select the "Backup4all_SFTP" certificate.
  10. Press Export public key option and type a name for the exported file. Example: Backup4all.pub
  11. Open the above exported file (Backup4all.pub) using Notedpad or another text editor.
  12. Download and install Putty from: https://www.putty.org/
  13. Open Putty, connect to your SFTP server and install the certificate from "Backup4all.pub" file.
    Example:
    type: *cd .ssh*
    type: *nano authorized_keys*
    Copy paste the certificate text on a new line and press Ctrl+X to close, then Y to save.
  14. In Backup4all you can test the connection and then you can run the backup.

Backup to SFTP server using personal certificate store

To make a backup to SFTP server with Backup4all, please follow these steps:
  1. Open Backup4all, press File -> New
  2. Press Advanced mode
  3. On General page, type a name for your backup job
  4. On Destination -> SFTP press Edit configuration
  5. Enter the SFTP server details
  6. Under Private key section, select Personal certificate store and choose Backup4all_SFTP certificate from the list.
  7. Press OK.
  8. Go to Sources page and add the backup sources.
  9. On Type page, select the backup type to use.
  10. Press Save and run.

Video Tutorial Backup to SFTP server