> For the complete documentation index, see [llms.txt](https://spacecore.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://spacecore.gitbook.io/wiki/ua/hetzner/change-the-root-password.md).

# Зміна пароля через Rescue

Забули пароль для вашого виділеного Linux сервера? Нічого страшного, давайте вирішимо цю проблему.

Спочатку потрібно перевести наш виділений сервер у режим відновлення (Rescue). Це можна зробити, використовуючи [інструкцію](https://wiki.spacecore.pro/ua/hetzner/control-panel-lk).

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

Використовуємо команду `lsblk`, щоб переглянути існуючі диски на нашому сервері. Якщо на вашому сервері використовується програмний RAID, вихід команди виглядатиме приблизно так. Зверніть увагу на розділи md, а саме md0, md1, md2:

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

Якщо програмний RAID не використовується на вашому сервері, то залежно від типів дисків, вихід команди виглядатиме приблизно так:

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

Далі потрібно змонтувати розділ основного диска. Оскільки на нашому тестовому сервері використовується програмний RAID, md2 підходить у цьому випадку.

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

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

Тепер вкажемо новий кореневий каталог для роботи з щойно змонтованим диском:

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

Основний процес завершено. Тепер нам залишається лише використати стандартну команду для зміни пароля відповідного користувача:

```
passwd root
```

Введіть новий пароль двічі.

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

Готово.<br>

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

Залишилося просто перезавантажити сервер у хмарній панелі або за допомогою команди `reboot`, щоб вийти з режиму Rescue. Після цього ми зможемо підключитися до нашого сервера, використовуючи новий вказаний пароль.

Якщо при використанні команди `reboot` виникає подібна помилка, потрібно скористатися комбінацією клавіш `CTRL + D`, щоб вийти з додаткової створеної сесії.

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

Чудово. Тепер ми можемо перезапустити наш сервер і розпочати подальшу роботу!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://spacecore.gitbook.io/wiki/ua/hetzner/change-the-root-password.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
