> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eykdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to configure SSH access for Magento

The default way to give Eyk access to your MySQL database server is through IP whitelisting. However, if this is not a viable option for you an alternative is to connect over an SSH tunnel to the MySQL database server. This how-to guide explains the steps to take to allow Eyk to connect to your MySQL database server over a secure SSH connection.

<Warning>
  Note that this alternative mode of connecting, and the below steps, are only required if IP whitelisting is not an option for your situation. If IP whitelisting is possible for you, you can follow the normal steps to connect Eyk to Magento.
</Warning>

To securely connect Magento to Eyk using public / private key encryption, you will need to add a public SSH key (provided below 👇) to the appropriate user account on the server. Depending on your Magento set-up either option A OR option B is applicable. Some Magento hosting providers allow you to manage SSH public keys through their admin control panel. If your Magento hosting provider has this functionality, the SSH key must be configured through the admin panel! Any SSH keys added directly on the server will be periodically overwritten. If you don't have a Magento hosting provider or your provider does not have SSH key management, you will need to add the key directly on the server in option B.

But first, collect the following credentials that you will need later on in this how-to guide.

| Name                                                          | Description                                                                                                                                |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| [SSH address](/guides/magento-ssh-access/ssh-tunnel-hostname) | The ip address or hostname of the server running the MySQL database                                                                        |
| [SSH port](/guides/magento-ssh-access/ssh-tunnel-port)        | The port on the server that is open for SSH connections (eg. 22)                                                                           |
| [SSH username](/guides/magento-ssh-access/ssh-username)       | The username of an user account on the server that Eyk should connect as over SSH. In the next step we will configure access for this user |
| [Store view IDs](/guides/magento-ssh-access/store-view-ids)   | Optional field. The store view IDs to collect data for. Leave empty to collect data for all store views.                                   |

<Info>
  When connecting to the server running the Magento MySQL database over SSH, the "Database host address" and "Database host port" will need to be set to the **local** address and port of the database.
</Info>

## Option A - Using the admin panel of your Magento hosting provider

If your Magento hosting provider allows SSH key management through their admin control panel, follow these instructions:

1. **Log in to the Admin Control Panel:** Use your credentials to access the hosting provider's control panel.
2. **Navigate to SSH Key Management:** Find the section dedicated to SSH Key Management.
3. **Add the Public SSH Key:**
   * Paste the below public SSH key into the designated field
   * Optionally give the SSH key a name like "Eyk"
   * Apply or save the changes

```text theme={null}
AAAAB3NzaC1yc2EAAAADAQABAAABgQCXqGAIgzLG8qbkD/PavKfNFC3spzI2aYCRexJt8IM/gOwOrnYANrMIB+ZhN1qhJyWqhnqweruIHcQigIAHJ+V4IDmGFhv601YHjMpQob8PnrVq33JNGsIJ2rYnkAOdu3zBKHxUT855WM/4/yd9ZGo0koGK8AA8T8T/Cj1J3JZ2ZPS09kxytLLGBj2Pe+fw5+fA0rUPglQMuCJ6KdgBtdUA0SqVbbitgfLTO5w4lsiuH+KqFjmiy1rkmxTAqIKHIFY4pcDEEi8X8mIAE8eFs6UOZV2kJzaaOf6PeX5b+qelXddqbfHkjI3w/w1V944XIJA9SFwnGpkrJVtgc8Nmcu4TQEKug4Q/zuCG94/uh5NsEubLlYbrMLvs47jBJ2MoIPI+lOc8k23nZbwSxNQ41FpcU4xxnPZSIwewr/usxCziLlT3CZ/EuN9jrikbHMe0AQLcdmXr7NZmiGTHs2E7hX6zrHpHaXs2+FJwJT//ttP5w+nv1KTEHgqKvPCYrYpe3N0= support@eykdata.com
```

<Warning>
  Adding the SSH key through the admin control panel is mandatory if this option is available, because in this case any SSH keys added directly on the server will be periodically overwritten.
</Warning>

## Option B - Directly on server

If your Magento hosting provider does not support SSH key management through an admin panel, or if you don't have a hosting provider, follow these steps to add the SSH key directly on the server.

<Note>
  💾 The below commands are for Linux servers. Not running on Linux or not so comfortable in a terminal? Contact support using the in-product chat and we'll help you set-up
</Note>

**Navigate to the home directory of the user**

On the server where the the MySQL database is running, navigate to the home directory of the user (corresponding with the **SSH Username**) by running the following command:

```bash theme={null}
cd /home/{{SSH Username}}
```

**Ensure the .ssh directory exists**

Run this command from the home directory of the SSH user:

```bash theme={null}
mkdir -p .ssh
```

**Add the Eyk public SSH key to authorized\_keys**

Run this command from the home directory of the SSH user:

```bash theme={null}
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCXqGAIgzLG8qbkD/PavKfNFC3spzI2aYCRexJt8IM/gOwOrnYANrMIB+ZhN1qhJyWqhnqweruIHcQigIAHJ+V4IDmGFhv601YHjMpQob8PnrVq33JNGsIJ2rYnkAOdu3zBKHxUT855WM/4/yd9ZGo0koGK8AA8T8T/Cj1J3JZ2ZPS09kxytLLGBj2Pe+fw5+fA0rUPglQMuCJ6KdgBtdUA0SqVbbitgfLTO5w4lsiuH+KqFjmiy1rkmxTAqIKHIFY4pcDEEi8X8mIAE8eFs6UOZV2kJzaaOf6PeX5b+qelXddqbfHkjI3w/w1V944XIJA9SFwnGpkrJVtgc8Nmcu4TQEKug4Q/zuCG94/uh5NsEubLlYbrMLvs47jBJ2MoIPI+lOc8k23nZbwSxNQ41FpcU4xxnPZSIwewr/usxCziLlT3CZ/EuN9jrikbHMe0AQLcdmXr7NZmiGTHs2E7hX6zrHpHaXs2+FJwJT//ttP5w+nv1KTEHgqKvPCYrYpe3N0= support@eykdata.com" >> .ssh/authorized_keys
```

<Tip>
  🙌 Great job! Your MySQL database server is now configured in a way that only the Eyk platform is able to connect to it over an encrypted connection 🔐
</Tip>
