---
title: Access and Test aapm-service Locally
slug: kronpam-how-to-guides-180/access-and-test-aapm-service-locally
docTags: 
createdAt: 2026-09-02T07:32:19.142Z
---

kubectl port-forward temporarily exposes the service on the server's own 127.0.0.1 address. To access it from your own computer, an additional SSH tunnel is required.

## Start a persistent port forward on the server

Without nohup ... & disown commands, this process terminates when the SSH session closes or the connection drops.

```linux
nohup kubectl port-forward svc/aapm-service 8443:8443 -n kron-pam-aapm > /tmp/pf-aapm-service.log 2>&1 < /dev/null &
disown
sleep 2
ss -tlnp | grep :8443
```

## Open an SSH tunnel from your own machine

```linux
ssh -N -L 8443:127.0.0.1:8443 <USER>@<SERVER_IP>
```

On Windows, if ssh/sshpass is unavailable, PuTTY's plink.exe can be used instead:

```linux
plink.exe -ssh -batch -pw <PASSWORD> -N -L 8443:127.0.0.1:8443 <USER>@<SERVER_IP>
```

## Send a test request

With curl command:

```linux
curl -X POST http://localhost:8443/vault \
  -H "Content-Type: application/json" \
  -d '{
    "accountName": "<ACCOUNT_NAME>",
    "accountPath": "<ACCOUNT_PATH>",
    "token": "<KRON_PAM_TOKEN>"
  }'
```

with Python:

```python
import requests

url = "http://localhost:8443/vault"
headers = {"Content-Type": "application/json"}
payload = {
    "accountName": "<ACCOUNT_NAME>",
    "accountPath": "<ACCOUNT_PATH>",
    "token": "<KRON_PAM_TOKEN>"
}

try:
    response = requests.post(url, headers=headers, json=payload)
    print(f"Status Code: {response.status_code}")
    print(f"Response Body: {response.text}")
except requests.exceptions.RequestException as e:
    print(f"An error occurred: {e}")
```

**Success criteria:&#x20;**&#x53;tatus Code: 200 and a "password" field in the response body.
