Please can you explain me how to install the latest security patches in Magento 2.1.2 via SSH.
There are no security patches for Magento 2. You need to update to the latest Magento 2.1.x release to get all security fixes.
You can upgrade in two ways. Both are covered extensively in the official Magento documentation.