# Port Mapping

## Overview

Rotation relies on the port field in resource records to determine its connection method.

For example, in a PAM Machine record, port 22 tells the gateway to use SSH, port 5985 for WinRM (http) and port 5986 for WinRM (https).

The expected standard ports are listed in the following table.

#### Rotation Standard Ports

<table><thead><tr><th width="195.33333333333331">Resource Type</th><th>Connection Type</th><th>Standard Port</th></tr></thead><tbody><tr><td>PAM Machine</td><td>SSH</td><td>22=ssh</td></tr><tr><td>PAM Machine</td><td>WinRM</td><td>5986=winrm</td></tr><tr><td>PAM Directory</td><td>Active Directory</td><td>636=ldaps</td></tr><tr><td>PAM Directory</td><td>OpenLDAP</td><td>636=ldaps</td></tr><tr><td>PAM Database</td><td>Postgresql</td><td>5432=postgresql</td></tr><tr><td>PAM Database</td><td>MySQL</td><td>3306=mysql</td></tr><tr><td>PAM Database</td><td>MariaDB</td><td>3306=mariadb</td></tr><tr><td>PAM Database</td><td>Microsoft SQL</td><td>1433=mssql</td></tr><tr><td>PAM Database</td><td>Oracle</td><td>1521=oracle</td></tr><tr><td>PAM Database</td><td>MongoDB</td><td>27017=mongodb</td></tr></tbody></table>

## Using Port Mappings

To use a non-standard port, specify the alternative port in two places:

* In the PAM Configuration port mapping field, enter `{port}=`{`connection}`, for example, `32636=ldaps.`
* For `{connection}`: refer to the labels under Standard Port in the standard ports table.
* In the PAM Machine/Directory/Database record, enter the chosen port in the port field

For example, to connect to a MySQL database using port 3307, your PAM Configuration should have `3307=mysql` under port mapping, and your PAM Database record should reference port 3307.

Multiple port mappings are newline-separated in the PAM Configuration.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeper.io/keeperpam/privileged-access-manager/references/port-mapping.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
