---
description: "Guide on what to do when customers lose SSH access to their server."
revision_date: 18.08.2026
---

# Recovering lost SSH access to an instance

1. Shut down the locked-out instance.
2. Detach the affected boot volume (or [clone it](https://docs.verda.com/storage/block-volumes/cloning-a-block-volume/) first if you want to keep the original untouched).
3. Create a new instance and [attach the volume](https://docs.verda.com/storage/block-volumes/attaching-a-block-volume/) as Additional storage:
    - Find the right partition. SSH into the new instance and run:

        ```bash
        lsblk -f
        ```

        Your old volume appears as `/dev/vdb`. Look for the partition holding the root filesystem.

    - Mount the volume. Replace the partition name if yours differs:

        ```bash
        mount /dev/your-partition /mnt/old-volume --mkdir
        ```

    - Log in as root:

        ```bash
        ssh root@your-ip-address
        ```

    - Add your key. The file you need to edit depends on which user you log in as. Open the correct file and add your new public key on its own line:

        - Logging in as root, edit: `/mnt/your-old-volume/root/.ssh/authorized_keys`
        - Logging in as any other user (for example ubuntu), edit: `/mnt/your-old-volume/home/USER/.ssh/authorized_keys`

        If you aren't sure, run the following command to see which users exist on the old volume:

        ```bash
        ls /mnt/your-old-volume/home
        ```

4. Unmount the volume, detach it from the temporary instance, and reattach it to the original instance in place of its boot volume, then boot it and try SSH again.

### Still locked out?

If the instance still won't accept your key afterward, contact [support](https://docs.verda.com/welcome-to-verda/contact-support/) through the chat in the console or by email.
