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 2048openssl 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 requestopenssl genrsa -out b4a_sftp.key 2048openssl 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 certificatesopenssl x509 -req -days 730 -in b4asftp.csr -CA b4aroot.crt -CAkey b4aroot.key -setserial 01 -out b4a_sftp.crt:: export certificatesopenssl pkcs12 -export -out b4acertifs.p12 -inkey b4asftp.key -in b4asftp.crt -chain -CAfile b4aroot.crt*
- Create another file called "mycertcfg.cnf" with the following content. Put both files in a new folder on your computer.
default_bits = 4096distinguishedname = reqdistinguished_namereqextensions = reqext*
countryName = Country Name (2 letter code)countryName_default = ROstateOrProvinceName = State or Province Name (full name)stateOrProvinceName_default = ClujlocalityName = Locality Name (eg, city)localityName_default = Cluj-NapocaorganizationName = Organization Name (eg, company)organizationName_default = SoftlandcommonName = Common Name (e.g. server FQDN or YOUR name)commonName_max = 64commonNamedefault = Backup4allsftp*
keyUsage=digitalSignature, keyEncipherment* - Download OpenSSL from: https://slproweb.com/products/Win32OpenSSL.html
- Install it in: "C:\OpenSSL-Win64" folder
- Open Command Prompt and run this command: set path=%path%;C:\OpenSSL-Win64\bin
- In Command Prompt run "makecertopenssl.bat" file. Some new files will be created in "C:\OpenSSL-Win64"
- Run the "b4a_certifs.p12" file, to install the certificate. Make sure you select the option to have this certificate exportable.
- Open Backup4all and create a new backup job using SFTP destination. Press Advanced mode button.
- On SFTP configuration page, configure the SFTP server.
- Select Personal certificate store option and select the "Backup4all_SFTP" certificate.
- Press Export public key option and type a name for the exported file. Example: Backup4all.pub
- Open the above exported file (Backup4all.pub) using Notedpad or another text editor.
- Download and install Putty from: https://www.putty.org/
- 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.
- 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:
- Open Backup4all, press File -> New
- Press Advanced mode
- On General page, type a name for your backup job
- On Destination -> SFTP press Edit configuration
- Enter the SFTP server details
- Under Private key section, select Personal certificate store and choose Backup4all_SFTP certificate from the list.
- Press OK.
- Go to Sources page and add the backup sources.
- On Type page, select the backup type to use.
- Press Save and run.