# Debugging apps with SSH

{% hint style="info" %}
This API requires at least [auterion-app-api: 2](/app-development/app-framework.md) to be available
{% endhint %}

Directly accessing your app via SSH can be beneficial, especially for debugging. When deploying apps on Skynode, the internal IPv4 address of specific docker containers will be determined at runtime. To improve the quality of live of developers, AuterionOS can automatically create dynamic SSH routes for apps such that the IPv4 address of the underlying docker containers does not need to be known.

## Enabling direct SSH access

### 1. Enable SSH port forwarding

In the auterion-app.yml file, enable SSH port forwarding by adding `ssh: true`

```
...auterion-app.yml...
services:
    <my-service-name>:
        build: <location of Dockerfile>
        ssh: true
```

### 2. Make sure you have openssh-server installed in your app

Make sure your app image contains `openssh-server` . If you are using the `auterion/app-base:v2` base image, you already have `openssh-server`

### 3. Create an SSH keypair

Create an SSH key-pair to use to access your app. You can do this from the command line

```
ssh-keygen -t ed25519 -f my-app-key
```

### 4. Insert public key in your app and start sshd

In your Dockerfile add your public key to the authorized keys. The public key can be found in my-app-key.pub.

```
RUN echo "ssh-ed25519 ....." >> /root/.ssh/authorized_keys
```

Change the command in your Dockerfile to make sure to launch the SSH Daemon (SSHD) with your app like so

```
CMD /usr/sbin/sshd && ./my-app
```

### 5. Access app

Now build and install the app. You can then use `auterion-cli app list` to locate the SSH port that was assigned to the app.

Open an SSH connection to your app by explicitely specifying the port to be used:

```
ssh -i my-app-key -p <port from auterion-cli app list> root@10.41.1.1
```


---

# 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.auterion.com/app-development/app-framework/ssh-access.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.
