Monthly Archives: April 2017

How to configure email encryption in Horde Groupware

In this post we will show how to configure Horde Groupware to use email encryption.
Horde Groupware is a free webmail program which you can access via cPanel at: yourdomainname.com/webmail.

We will assume that you already generated your key pair in cPanel->Encryption. Look at this KB post: Create public and private GnuPG keys for email encryption in cPanel

  1. Login with your credentials at yourdomain.com/webmail and select the Horde option.

horde groupware 1

2. From the Horde menu go to  Preferences->Mail

horde groupware 2

3. Then choose PGP

horde groupware 3

4. On the PGP page, check the Enable PGP functionality? option and click Save.

horde groupware 4

5. Now on the Horde PGP page you will see more options.

  • Use the Import Public Key button to import public keys. A new entry will be created in the Address Book – entry that will contain the public key of that email.
  • Use the Import Key button to import your private key. It will be used to encrypt messages that you send.

horde groupware 5

Do not give your private key to anyone! Send only your public key.

6. When sending messages you can select if you want to encrypt or not the message. Don’t forget that only recipients that have your public key will be able to read the messages you choose to encrypt.

horde groupware 6

A public/private key looks like:

—–BEGIN PGP PUBLIC KEY BLOCK—–
Version: GnuPG v2.0.22 (GNU/Linux)

mQGiBFkGByURBACO3t9ym4Yjzd2j2B/0H5rdsrxVCQyM+wca+AdVWq7jMM6maXN4
MZixCh8TgNYErSuDw8tMVKdLfPEYpwkJVkKqc7JyJuOsffPomXdf8IVfAaRnRRQ7
+cM0slgFFriBKyuDbZfuElNuoGTduc3uIQqwYgwYPUd2XtG17+A9ggNdDwCgtUjr
xZrsf7N910vSMzLuAowB1zsD/3QKl0QmDAYdy2Fr/ndoPg4rduHI5v8bUCQ8nPHD
Da+TjpA6TP0IQCW43+ab4BjE6UMn0ZTCP6G0qN5DhJJyONPZgdHK66Faq/Ar8lqP
Oj8PIXOQaVoIWelUnvnZt7iQq2WrxzHqY+zDg8fBdrdtvRBC0CMgI/g8ocLlykmz
HHJzBACLwBjo11gzRZw7l+J7nVBixVApbXGq/L7p/HmjOmgAYEf+cXfrhlME+PKs
tQmwo3vhnZCUI3uopv3eWUZXgzM3V5MHt51a2EvpNCnyuugiUFywR17RgddGOVRJ
GXk6Oe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5zWH3MZXIaZg==
=2arU
—–END PGP PUBLIC KEY BLOCK—–

Related KB: Create public and private GnuPG keys for email encryption in cPanel

Share this post:

Create public and private GnuPG keys for email encryption in cPanel

To use email encryption the first step is to generate your private and public key for your email address. You can generate these keys in cPanel. Your messages will be encrypted with the private key. The recipients will decrypt the messages using your public key.

Do not give your private key to anyone! Give only your public key.

Steps to generate private and public keys for email encryption:

  1. Connect to your cPanel account
  2. Look for Encryption (EMAIL section)
  3. Here enter the details for:
    – Your Name
    – Your Email
    – Comment or Nickname
    – Key Password (you can use the Password Generator)
    – Expiration Date (1y (1 year) 3w (3 weeks) 5d (5 days) 0 (No expiration date))
    – Key Size (2048 or 4096)
  4. Click the Generate Key button. You will see a message at the top of the page saying “Key is being generated. This may take a few minutes.
  5. Wait for a few seconds and you will see “The Key has been successfully created.” 
  6. Refresh the page and you will see the private and public keys.
  7. To view and copy a key click the View link.
cPanel Email Encryption
cPanel Email Encryption
To delete the keys, delete the private key. The public key will be automatically deleted. Notice that you can’t delete the public key. If you try to delete the public key, you will receive an error message: “Sorry, you must delete the secret key before removing the public key.

The short video how-to is here:

Resources:

https://www.gnupg.org/

Related KB: How to configure email encryption in Horde Groupware

Share this post:

Create a DNSSEC record for your domain in cPanel

Domain Name System Security Extensions (DNSSEC) adds a layer of security to the old DNS system. There are two steps for using it: 1. creating the DNSSEC record on your cPanel account. 2. letting your domain registrar know that you want to use DNSSEC.

Create a DNNSEC record in cPanel

  1. Connect to cPanel account
  2. Look for DOMAINS section, select Zone Editor
  3. Click DNSSEC link for your domain
  4. Click the Status field to enable DNSSEC. In few seconds, a new key will be created for your domain. 
  5. That’s everything on the cPanel side.
cPanel DNSSEC
cPanel DNSSEC

Movie on how to generate the DNSSEC key in cPanel:

Registrar configuration

This step depends on your registrar. Anyway, you will need all the key details from cPanel: Key Tag, Algorithm(8 RSA/SHA-256 0 bits), Digest Type(1 SHA-1, 2 SHA-256 or 4 SHA-384) and Digest. You can check the tutorials from Namecheap and GoDaddy.

For other registrars, please contact their support team.

Resources:

Wikipedia DNSSEC page

Share this post:

Check active FTP connections to your hosting account in cPanel

cPanel allows you to see all active FTP connections to your web hosting account. You also have the possibility to disconnect users.

Steps to see the live FTP connections:

  1. Connect to your cPanel account
  2. Look for the FILES section, click on FTP Connections link
  3. Under Current Connections you will see the list of the FTP connections (you can also connection details, like IP, Login Time, Connection Status)
  4. Use the Reload button, to reload the active connections
  5. If you want to disconnect an user, click the Disconnect link. Confirm the action. 
cPanel FTP Connections
cPanel FTP Connections

Check the video tutorial here:

Share this post:

How to optimize MySQL/MariaDB tables

The commands from this post will work on MySQL and MariaDB server.

It’s a good idea to perform database maintenance from time to time. One thing is to do is to optimize the tables. We have two options:

1. OPTIMIZE TABLE command

Reorganizes the physical storage of table data and associated index data, to reduce storage space and improve I/O efficiency when accessing the table. The exact changes made to each table depend on the storage engine used by that table.

See below how to use it.

root@web [~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3670
Server version: 10.1.22-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use roundcube
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [roundcube]> OPTIMIZE TABLE cache;
+-----------------+----------+----------+-------------------------------------------------------------------+
| Table           | Op       | Msg_type | Msg_text                                                          |
+-----------------+----------+----------+-------------------------------------------------------------------+
| roundcube.cache | optimize | note     | Table does not support optimize, doing recreate + analyze instead |
| roundcube.cache | optimize | status   | OK                                                                |
+-----------------+----------+----------+-------------------------------------------------------------------+
2 rows in set (0.04 sec)

MariaDB [roundcube]> quit
Bye
root@web [~]#

If you want to run the command for multiple tables from the same database, use:

OPTIMIZE TABLE table1,table2,table3;
OPTIMIZE TABLE works with InnoDB, MyISAM, and ARCHIVE tables.

2. mysqlcheck command

The mysqlcheck client performs table maintenance: It checks, repairs, optimizes, or analyzes tables.

To check one table use: mysqlcheck db_name tbl_name
To check all tables from a database: mysqlcheck –databases db_name
To check the tables from all the databases on the server: mysqlcheck –all-databases

Notice that database tables are locked while mysqlcheck is running. No records can be inserted or deleted from the tables.
root@web [~]# mysqlcheck roundcube
roundcube.cache                                    OK
roundcube.cache_index                              OK
roundcube.cache_messages                           OK
roundcube.cache_shared                             OK
roundcube.cache_thread                             OK
roundcube.contactgroupmembers                      OK
roundcube.contactgroups                            OK
roundcube.contacts                                 OK
roundcube.cp_schema_version                        OK
roundcube.dictionary                               OK
roundcube.identities                               OK
roundcube.searches                                 OK
roundcube.session                                  OK
roundcube.system                                   OK
roundcube.users                                    OK
root@web [~]# 

To optimize a database, use:

root@web [~]# mysqlcheck -o roundcube
roundcube.cache
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.cache_index
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.cache_messages
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.cache_shared
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.cache_thread
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.contactgroupmembers
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.contactgroups
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.contacts
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.cp_schema_version                        Table is already up to date
roundcube.dictionary
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.identities
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.searches
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.session
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.system
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
roundcube.users
note     : Table does not support optimize, doing recreate + analyze instead
status   : OK
root@web [~]#

To optimize all the database on the sever use:

root@web [~]# mysqlcheck -o -A

Resources:
OPTIMIZE TABLE manual
mysqlcheck manual

Share this post:
Page 1 of 7
1 2 3 7