openssl


Encrypting and Decrypting data using SSL Key

First generate the RSA key (key.pem): openssl genrsa -out key.pem 4096 openssl rsa -in key.pem -text -noout   Then save the public key in pub.pem: openssl rsa -in key.pem -pubout -out pub.pem openssl rsa -in pub.pem -pubin -text -noout   As an example we're creating a simple text file and encrypt it: echo test12345 > […]


Creating an encrypted Databag in Chef

Create a random encryption key: openssl rand -base64 512 | tr -d ‘\r\n’ > secret_key Use this to encrypt a data bag item named “passwords” located in a data bag named “production”: knife data bag create −−editor /usr/bin/vi −−secret-file ./secret_key production passwords This will open an text editor, example JSON data would be: { “id”: “passwords”, […]


Verify SSL certificate using OpenSSL

Use this command to verify the SSL certificate for the domain www.example.net: openssl s_client -showcerts -connect www.example.net:443 If you want to give the folder which contains the CA certificates (on Debian /etc/ssl/certs): openssl s_client -connect www.example.net:443 -showcerts -CApath /etc/ssl/certs If the certificate is correctly installed the result should contain at the end: Verify return code: […]


ProFTPd with MySQL Backend on Debian

First of all we install the needed packages: apt-get install proftpd proftpd-mysql mysql-server The configuration files of the proftpd server are in /etc/proftpd. First we edit the file /etc/proftpd/modules.conf and add the following lines as indicated: LoadModule mod_sql.c LoadModule mod_sql_mysql.c Then we should create the mysql database and the table that will contain the proftpd users: […]