# Access remote files with SSHFS

In Nuvolos applications, you can access files stored on your server via a secure SSH connection and use them as if they were on the file system of the Nuvolos application.

## Prerequisites

### Create a personal SSH key

To be able to authenticate with your server using SSH, you will need to create an SSH key in Nuvolos and add the generated public key to the `authorized_keys` file on your server to accept the newly generated SSH key. Under Linux systems, the file is usually located under `~/.ssh/authorized_keys` .

To do this, [go to your account settings](https://app.nuvolos.cloud/user/settings/profile) and click on the *SSH Keys* tab. Click on the **+ GENERATE SSH KEY** button to create an SSH key.

Nuvolos will automatically try all of your SSH keys when using SSHFS.

### Create a shared SSH key

If you want to use the same SSH key for connecting from a specific space with different users, you can use the [space secrets](/features/environment-variables-and-secrets.md#space-secrets) feature of Nuvolos. If you set secrets with the following names, they'll be tried as private keys during SSHFS connection phase:

* id\_rsa
* id\_dsa
* id\_ecdsa

{% hint style="info" %}
The key type does not need to match the filename (e.g. a RSA key can be put under id\_dsa), but it's important to use all lowercase for the above names. Also, make sure to add a **trailing new line** after the -----END OPENSSH PRIVATE KEY---— line when setting the secret.
{% endhint %}

### Configure the connection using environment variables

Next, set the following environment variables, either on a user level in your [Nuvolos user settings](https://app.nuvolos.cloud/user/settings/env-vars) or on a space/organization level in the space/organization settings:

* `SSHFS_USER`: The username to use when connecting with the remote host. (default: Nuvolos username)
* `SSHFS_PORT`: The port to connect on to the remote host. (default: 22)
* `SSHFS_SERVER`: The SSH server Nuvolos applications will connect to.
* `SSHFS_REMOTE_PATH`: The path on the remote SSH server to be mounted. Use full path and avoid \~ as it will be expanded on Nuvolos, not the remote.

## Debugging SSHFS connection

If you have trouble setting up your connection, you can set the `SSHFS_DEBUG` environment variable to 1 using [space level](/features/environment-variables-and-secrets.md#space-secrets) or [account](/features/environment-variables-and-secrets.md#account-secrets) secrets. This will enable verbose logging in the SSHFS sidecar, and you can check the [logs for your session](/features/applications/sessions/session-logs.md) to troubleshoot.

## Configuring your Nuvolos application

The SSHFS add-on can be added on the application configuration screen. See [Enabling add-ons](/features/applications/add-ons.md#enabling-add-ons) for step-by-step instructions.

{% hint style="info" %}
Please restart your application, if it is currently running, for the changes to take effect.
{% endhint %}

## Accessing remote files

Once the prerequisite configuration has been done and the applications have been also configured to use SSHFS, you can start your Nuvolos application.

The files from the remote server will be accessible under the path `/sshfs`. If you wish to use a different path, please reach out to Nuvolos support.


---

# 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.nuvolos.com/features/file-system-and-storage/access-remote-files-with-sshfs.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.
