# Password change via Rescue

Have you forgotten the password for your dedicated Linux server? There's nothing wrong with that, let's solve this problem.

First of all, we need to put our dedicated server into recovery mode (Rescue). This can be done using [instructions.](https://wiki.spacecore.pro/en/hetzner/control-panel-lk)

<figure><img src="/files/24YfIBdOKf1DvvTS6VkA" alt=""><figcaption></figcaption></figure>

We use the `lsblk` command to view the existing drives on our server.

If you are using **Software** **RAID** on your server, the output will be something like this. Pay attention to the md sections, namely md0, **md1, md2**

<figure><img src="/files/ncDECDiaEPVrBNqUzycw" alt=""><figcaption></figcaption></figure>

If Software RAID is not used on your server, then depending on the types of drives, the output of the command will look something like this:

<figure><img src="/files/Zr86hIX0j28mRcG4TEXE" alt=""><figcaption></figcaption></figure>

Next, you need to mount the partition of the main disk. Since Software RAID is used on our test server, **md2** is suitable in this case.

```
mount /dev/md2 /mnt
```

Great!

<figure><img src="/files/ASJncUzhUd4FuAjAWyll" alt=""><figcaption></figcaption></figure>

Now we specify a new root directory to work on the newly mounted drive:

```
chroot /mnt /bin/bash
```

The main process is completed. Now all we have to do is use the standard command to change the password of the corresponding user.

```
passwd root
```

We enter the new password twice.

<figure><img src="/files/QxTvDaYBaiYtNtXNlNcy" alt=""><figcaption></figcaption></figure>

Done.<br>

<figure><img src="/files/LvJh6GMIz99FyCpDnpHg" alt=""><figcaption></figcaption></figure>

It simply remains to restart the server in the cloud panel or with the `reboot` command to exit **Rescue** mode. After that, we can connect to our server using the new specified password.

If you get a similar error when using the `reboot` command, then you need to use the `CTRL + D` keyboard shortcut to exit the additional created session.

<figure><img src="/files/mHfSxUXa24xQKkY9pLHL" alt=""><figcaption></figcaption></figure>

Great. Now we can restart our server and start further work!


---

# 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://spacecore.gitbook.io/wiki/en/hetzner/change-the-root-password.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.
