Did you know that you can access your site server with greater security without needing a VPN? Yes, you can use RSA private encryption keys, which is a basic security measure but not all developers are aware of them.

Teaching you a better method for having greater security when you access your server machine is what this article is about. Using greater security methods you can protect your work from being stolen or destroyed.

RSA private encryption keys allow you to access a server securely using a console terminal. You can connect to a server using the the SSH protocol and then you can enter commands line by line like regular shells.

These RSA keys allow you to tell your server you are indeed who you claim you are by installing keys on your machine and at the server side, so unauthorized users will not be able to access the server because they do not have your private keys.

Read this article now to learn all the steps necessary to configure your SSH access to a server machine using an RSA key.

Contents

Introduction

Requirements

Conventions

Instructions

Additional Configuration Steps

Conclusion

Related PHP Packages and Articles

Introduction

Using the ssh protocol based commands or GUI based tools to access your servers is a great security practice but first you need to learn how to setup the RSA keys before you start accessing your servers this way.

There are several situations on which you will need access to a remote server, but VPN is not an option due to the equipment that your client has, or you have. In these situations, having an encrypted communications channel to their server, is the next best thing to using a VPN.

To achieve this, I will explain how to configure SSH so that users can authenticate using an RSA key, instead of two factor authentication.

The SSH command already has the encrypted tunneling feature built in. So, VPN is not needed. But to setup secure authentication that is based on an RSA certificate key, this article presents the necessary steps that you need to perform.

Requirements

This tutorial assumes that several systems will be used titled Server, User Desktop (or Client), File Server, and VM Server (virtual machine server). One or more of these systems can be hosted as VM Guest (virtual machine host).

The Server used in this demo is a Fedora 26 Server (no GUI desktop) but could be any other type of Linux system or another one that provides similar SSH protocol support. The Server is a VM Guest, hosted with Oracle VM VirtualBox 5.1.28 in Fedora 26.

The Client will be a Fedora 26 with the Mate desktop experience.

Conventions

For clarity I am using the following conventions that you need to pay attention to understand the explanations that follow below.

[value] := is a variable that will be captured by the user as the information Web server is setup and configured.

Command Format := provides the reader with an example of the command and parameters where the command line or file name may be variable.

> := the greater than symbol will preceed any shell command. If a command generates any kind of output, such output will be displayed after the command.

At the [Environment] ... := tells the reader which environment they should be working in for the instructions to follow. There are three (3) environments in this tutorial: Client, VM Server, Server.

Additional Configuration Steps

You will need to configure the "port forwarding" option from the routers connected to Internet, to forward all packets from port 22, to the Server.

If the Server is running in a VM, create a Client that sits in a VM as well, and both are running in the same VM Host. The Client will allow you to install LogMeIn or TeamViewer to remotely connect to troubleshoot issues locally, vs remotely. The Client will also allow you to connect to the Server if needed.

Conclusion

Now that you know how to use RSA keys to access remote machines using the SSH protocol, you should use them specially when you need extra security in case somebody steals your password and accesses you servers pretending to be you.

There are other important matters related with SSH and RSA encryption when using PHP on the server side that you may learn more by reading other articles or studying PHP packages linked below.

For now, if you liked this article share it with your colleague developers to tell them about the things here they may not be aware. If you have questions or doubts, post a comment below so I can give you more reply with what you need.