Что делать, если забыт пароль root?

Stack Exchange Network

Visit Stack Exchange

Привет! Подскажите други)

Ставил через нетинсталл, чего-то намудрил с рутом. Пароль один что у юзера что у рута. Под юзером захожу, а при пlolтке зайти прод рутом пишет

alex is not in the sudoers file. This incident will be reported.

но при пlolтке загрузится в рекавери пишет

Welcome to emergency mode! After logging in, type «journalctl -xb» to view
system logs, «systemctl reboot» to reboot, «systemctl default» to try again
to boot into default mode. Cannot open access to console the root account is locked

Press enter to continue

Premium Powerups English / Global Deutsch Español Français Italiano Português Help Center Reddit iOSReddit AndroidReddit PremiumAbout RedditAdvertiseBlogCareersPress

Terms & Policies

Go to Kalilinuxr/Kalilinux

Что делать, если забыт пароль root?

I have Fedora 35 fairly new install. I did a dnf update and rebooted. Now i get this msg:

But that doesn’t work for me. I booted from F35 live cd, did the mount sda2 and mounted sda1 as boot.

Did proc, dev, etc. like instructions said without error and also chroot.

when i run passwd i get this:

And that’s it. What the heck is going on? someone please help as i need to get this damn pc running to do real work.

Raspbian Stable, поставил часть пакетов из Testing. Система после ребута чего-то там по UUID сначала не может примонтировать, потом какие-то сервисы запустить. Хотел посмотреть журнал нормально. Ну и витоге Перекидывает в Emergency mode, соответственно

Cannot open access to console, the root account is locked

Не хотелось разбираться ещё и с чрутом под арм процессор — очень гемморно. Можно как-то примонтировав флешку правкой файлов задать пароль рута и разрешить вход хотя бы? Хотелось разобраться, что там не так. А то переустанавливать и обновлять хз сколько буду и к такому же результату могу прийти, ещё куча времени впустую.

Приключилась беда. На ноуте (uefi/gpt) стоят W10 и Fedora 33. W10 стоит на отдельном SSD 128Gb — отлично работает. Fedora стоит на отдельном разделе другого HDD(1/4 винта 1Gb)
Раздел зашифрован полностью. / /home /swap. Раздел /boot на флешке.

Вообщем мне приспичило поставить вместо HDD с федорой другой хард и накатить WXP и W7. Отработал. Меняю винт обратно и Fedora не грузится.

Ее вообще не видно при загрузке. Пробовал восстанавливать загрузчик с помощью Live Fedora флешки — linux rescue но дает ошибку cannot open access to console root account is locked

При загрузке с Live Fedora шифрованный диск в порядке.

Подскажите если не трудно поднобно, как ручками прописать нужные команды чтобы Fedora снова начала грузиться с флешки.

Table of contents
  • How Do I Get Root Privileges In Kali Linux?
  • How Do You Unlock A Root Account In Linux?
  • What Is The Root Password For Kali Linux?
  • How Do I Get Root Permission In Kali Linux?
  • How Do You Fix Cannot Open Access To Console The Root Account Is Locked?
  • What Is Root Privileges In Kali Linux?
  • How Do I Get Root Privileges In Linux?
  • What Is Root Privileges In Linux?
  • How Do I Unlock A Linux Account?
  • How Do I Bypass Root Password In Linux?
  • What Is The Sudo Password For Kali?
  • What Is The Root Password For Linux?
  • How Do I Login As Root In Linux?
  • How Do I Open The Root Directory In Kali Linux?

Добрый день. Переношу /boot раздел на флешку следующим образом:

sudo mount /dev/sdb1 /mnt/
sudo cp -p -r /boot/* /mnt/
sudo ls -l /mnt
sudo rm -r -f /boot/*
sudo nano /etc/fstab
UUID=085d1d30-fa19-4144-a146-2e88821e75ff /boot ext4 defaults 0 2
sudo umount /mnt/
sudo mount /dev/sdb1 /boot/
sudo grub-install /dev/sdb
Установка успешна, ошибок нет. sudo update-grub
Всё ок.

Но далее при перезагрузке, пишет ошибку:

Error: file ‘/boot/grub/i386-pc/normal. mod’ not found. Entering rescue mode.

Сама флешка содержит следующие файлы:

grub
— fonts
— i386-pc <— Внутри этого каталога присутствует /boot/grub/i386-pc/normal. mod
— locale
— grub. cfg
— grubenv
unicode. pf2
system. map-4. 0-8-amd64
config-4. 0-8-amd64
vmlinuz-4. 0-8-amd64

Это я переношу вручную, но также при попытке автоматического переноса устанавливая с 0 систему, выбивало такую же ошибку. Гугл ничего толком не говорит. Подскажите, как исправить?

Fedora &amp; root account is locked boot issue — Solution

Well, the wheel of time has dumped us back at the beginning. The same issue happened again. I had
(somewhat) recently upgraded an instance of
Fedora 29 to Fedora 30, and lo and behold, I found myself facing
the same problem. Almost. I had a black screen, and a message that said:
Cannot open access to console, the root account is locked. At this point,
trying to do anything didn’t yield any results. I could only reboot. I did try another kernel, and this
helped — I got to my desktop. While the issue seems to be similar, I had to go a slightly
different way about fixing it.

Запись от KellyDink размещена 26. 2017 в 22:28

Дополнительно:  Hkey classes root gpo

Обновил(-а) KellyDink 13. 2017 в 10:22

сбросить пароль так же не просто, как кажется) Астра линукс сертифицированная система, которая обладает встроенными механизмами разграничения доступа и защиты от НСД. Но все-таки она линукс и сбросить пароль можно.

Это можно сделать несколькими способами, я испробовала 2 из них. Во-первых, при загрузке GRUB можно нажать «e» и, если Вы вспомните пароль от рута, то зайти в режим командной строки. Для этого в конце строки, начинающийся с «

linux /boot/vmlinuz-.

mount -rw -o remount /

/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

Дальше надо отредактировать файл

после чего понять, что ничего не помогает и вернуться в терминал:

Ошибки, с которыми я столкнулась и их решение
если ни с того, ни с сего на любую команду терминал начал выдавать

error openning termiinal:bterm

When you mount an USB drive to your Raspberry Pi and set it up to automatically mount to the system using fstab you cannot restart the system without the HDD connected!You are in emergency mode. After logging in, type “journalctl -xb” to view
system logs, “systemctl reboot” to reboot, “systemctl default” or ^D to
try again to boot into default mode. Press Enter to continue. It looks like this:

Что делать, если забыт пароль root?

Emergency Mode due to missing external usb drive while using fstab for auto mount after reboot. Just add a option to the statement:That means: External devices (like USB HDDs) that are to be mounted when present but ignored when they are not online (due to missing plug or damaged HDD) require the nofail statement. This prevents the error being reported as shown above. As of the default device timeout over 90 seconds, you can combine the statement with the option x-system. device-timeout=X. With this you fasten up your boot time a lot :)So the whole statement has to be look as:As you can see below I added this options on all my external USB drives. It works like a charm.

Что делать, если забыт пароль root?

Cannot open access to console, the root account is locked. While not too descriptive, the error message asked me to use sulogin and run journalctl -xb; however, there was no shell to run or list anything.

  • Retrieve your SD card from the Pi and sing an adapter mount the card to your PC, Mac or Linux.
  • You should be able to see the /boot partition of your SD card.
  • Load the SD card back to your pi and boot up.
  • You should now get a root shell prompt. From here, you can undo the changes to /etc/fstab or whatever else that initially broke your system

Method 1:Step 1: To begin, download the kali-root-login package with the apt package manager. $ sudo apt install kali-root-login

Что делать, если забыт пароль root?

$ sudo dpkg-reconfigure kali-grant-root

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Step 4: Ensure that “enable password-less privilege escalation” is selected before clicking enter to proceed further.

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Step 6: It’s as simple as that. You can even use the Sudo command to perform all subsequent commands as root, but you will never require a password. Try logging out and then in, then perform a command that typically requires root access to see whether it works.

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Step 3: You can now verify that you are in the root by using the appended command.

Что делать, если забыт пароль root?

Permanent vs temporary usage

However, there may be other times where you may want to use root across multiple sessions without the hassle of elevating privileges. In these situations we will need to install a package and make a few modifications to fully enable the root account for use due to security reasons of keeping the root account disabled by default.

Enabling the root account

Please note that the password prompt will not display output as you are typing in the password, but it will still register the keystrokes.

The next thing we need to decide is if we are wanting to use root via SSH or through the login prompt on whichever desktop environment is installed.

Enabling root for SSH

If we look at /etc/ssh/sshd_config we will see a PermitRootLogin line. We will want to change this line to match our use case.

If we have set up SSH key based login for the root account, then we can simply uncomment the appropriate line and continue on. Otherwise, we should change PermitRootLogin to be yes which will allow us to input a password.

Enabling root for GNOME and KDE login

We will first install kali-root-login to change multiple configuration files that will permit us to login to the root account through the GNOME GDM3 and the KDE login prompt. This step is not necessary when using other desktop environments.

  • Open the terminal. Ubuntu and several other distributers lock the root account automatically to prevent you from using commands that can damage your system. You can unlock the root account in the terminal. If you’re in the desktop environment, you can press ‘Ctrl + Alt + T to start the terminal.
  • sudo passwd -dl root
  • Open the terminal. If the terminal is not already open, open it. Many distributions allow you to open it by pressing Ctrl + Alt + T.
  • Enter the root password when prompted. After typing «su -» and pressing Enter. You’ll be prompted for the root password.
  • Enter the commands that require root access. Once you’ve used su — to log in as root, you can run any commands that require root access. The su command is preserved until the end of the session, so you don’t need to keep re-entering the root password every time you need to run a command.
  • sudo is the preferred method for distributions like Ubuntu, where it will work even when the root account is locked.
Дополнительно:  Решаем проблему, как включить тачпад в Windows 10

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

  • If you need root access to perform a command, use the method in the previous section.
  • In many cases, the root password may be «password.»If you don’t know the root password, or have forgotten it, see the next section for instructions on resetting it.In Ubuntu, the root account is locked and cannot be used until it has been unlocked.
  • In many cases, the root password may be «password.»
  • If you don’t know the root password, or have forgotten it, see the next section for instructions on resetting it.
  • In Ubuntu, the root account is locked and cannot be used until it has been unlocked.
  • Avoid running complex programs while logged in as root. There’s a chance that the program you intend to run will have a negative effect on your system when it has root access. It’s highly recommended that you use sudo or su to run programs instead of logging in as root.
  • Reboot your computer and hold left-.⇧ Shift after the BIOS screen. This will open the GRUB menu.The timing on this can be tricky, so you may have to try multiple times.
  • The timing on this can be tricky, so you may have to try multiple times.
  • Select the first .(recovery mode) entry on the list. This will load recovery mode for your current distribution.
  • Select the .root option from the menu that appears. This will start the terminal with you logged in as the root account.
  • mount -rw -o remount /
  • Create a new password for any accounts you’re locked out of. Once you’re logged in as root and have changed the access permissions, you can create a new password for any account:Type passwd accountName and press . If you need to change the root password, type passwd root.Enter the new password twice when prompted.
  • Type passwd accountName and press . If you need to change the root password, type passwd root.
  • Enter the new password twice when prompted.

Add New Question

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

The Problem

The temporary workaround — Setting last field to ‘0’ in /etc/fstab — is a terrible idea

After I set it to ‘0’, on the next dirty shutdown and subsequent boot, a huge problem surfaced.

The root file system was being mounted as read-only.

Found this and this, which explained the situation clearly

The default behaviour for most Linux file systems is to safeguard your data. When the kernel detects an error in the storage subsystem it will make the filesystem read-only to prevent (further) data corruption.

perhaps it is because the disk is unclean, try changing:
/dev/sda1 / ext3 defaults 0 0
to
/dev/sda1 / ext3 defaults 0 1
or at least do an fsck and then reboot

The Solution

  • The obvious solution was to revert /etc/fstab to its original state, and run fsck to clean the filesystem
  • However, I could not write to /etc/fstab, since the file system is read only.
  • dmesg told me this
    EXT4-fs (mmcblk0p2): Couldn’t remount RDWR because of unprocessed orphan inode list. Please umount/remount instead
  • EXT4-fs (mmcblk0p2): Couldn’t remount RDWR because of unprocessed orphan inode list. Please umount/remount instead
  • Found this answer which solved the orphan inode problem.
  • After that, e2fsck asked me to reboot. After the reboot, root was clean and had write access by default.
  • To avoid future chaos, I reverted /etc/fstab to its original state.

Comments

Only after pressing enter the OS is loaded. Does someone know how to get rid of this issue?

I had to remove it by editing the file externally on my laptop. Once I plugged the SD card back in, my pi worked as per normal again.

had the same problem and managed to fix it by «verifying» both boot and system partition with gparted on linux. Steps are:

Problem symptoms in more detail

I found myself quite stumped by the lack of accessible diagnostic tools or a usable environment in
which I could troubleshoot the issue. To have to reboot means losing possibly valuable information. At
the very least, I could boot into other kernels, which meant I had something to work with.

In Fedora, you do get some — but not all of these files. For instance, boot. log is there, but
then:

sudo less boot. log
«boot. log» may be a binary file. See it anyway?

Funnily, it IS a text file (with some weird characters), and you can actually display it with cat. But this file did not yield any useful information that would help me pinpoint the issue.

I then spent a bit more time reading on different options for journalctl, and it does give you the
option to see the previous boot logs. You can do this by providing a negative integer value to see the
old logs. This is not very intuitive, but at least it gave me what I needed, although I resent the
binary log format idea in principle. You’ve seen this recently when I debugged the
borked laptop issue. Similar theme.

Here, I went through the lines, looking for errors. While the systemctl thingie didn’t help earlier,
with this command, I did eventually come across the critical boot problem:

ls -ltr initramfs*
-rw——-. 1 root root 73443963 May 19 2018
initramfs-0-rescue-efe3eec4bb6646fe864735812f4d094b. img
-rw——-. 1 root root 22953495 Apr 2 15:54 initramfs-5. 4-200. fc29. x86_64. img
-rw——-. 1 root root 22961687 May 20 13:11 initramfs-5. 16-200. fc29. x86_64. img
-rw——-. 1 root root 23015208 May 20 21:17 initramfs-5. 16-300. fc30. x86_64. img

Дополнительно:  Синий экран смерти Windows 10: причины, способы решения

The last one was the culprit, while the one before (above) worked fine. Whatever happened during the
update rendered the second initramfs corrupt, without the vfat module to allow the correct mounting of
the filesystem. Out of curiosity, I decided to extract the images to see the differences — which
confirmed my suspicion. Again, this wasn’t the most trivial of exercises, because you cannot use zcat
and cpio to extract the initarmfs files like in the past, you need a more complex combo:

Well, you have several options here. One, if you have a second copy of Fedora on the same box, and
it is working, then you can copy its initramfs file over and use it, like I did in Ubuntu back in the
day. This isn’t a trivial option, but if you have it, you’re lucky!

If you don’t, then older kernels should help — like they did in my scenario. Then, you can run a
system update or manually recreate initramfs files. You can read my
Ubuntu slow boot article for details on how to do this. If
you can’t boot into any other kernel, and you have no other Linux instances on the host, then your last
option is to use the live session and then perform the recovery there — or reinstall.

Как восстановить доступ к Debian Linux в случае проблем с sudo или утратой root-пароля

Что делать, если забыт пароль root?

Загрузка в recovery mode

В типичных ситуациях в Linux имеется режим восстановления Recovery Mode, который, как правило, доступен из загрузчика ОС. В этом режиме наша Linux-система доступна в режиме супер-пользователя root, и мы можем исправить в ней имеющиеся у нас проблемы, например внести корректировки в файлы sudo или добавить/изменить учётные данные локального администратора.

Для того, чтобы попасть в меню загрузки, в процессе запуска ОС Debian нажимаем кнопку Shift. В появившемся меню загрузчика GRUB выбираем расширенный режим загрузки:

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

Однако в случае с Debian, где супер-пользователь root в конфигурации по умолчанию выключен, мы можем получить сообщение о невозможности загрузки консоли восстановления «Cannot open access to console, the root account is locked»:

Что делать, если забыт пароль root?

В таком случае мы можем прибегнуть к приёму изменения параметров загрузки ядра.

Нестандартная загрузка

В процессе загрузки в GRUB выбираем в списке ядер нужное нам ядро (режим recovery mode здесь уже не важен) и нажимаем «e» для редактирования параметров загрузки.

Что делать, если забыт пароль root?

Что делать, если забыт пароль root?

В конце строки меняем значение «ro» на «rw», а в самом конце строки дописываем вызов оболочки «init=/bin/bash».

Что делать, если забыт пароль root?

После чего для продолжения загрузки жмём F10

Что делать, если забыт пароль root?

Теперь мы получили беспарольный root-доступ к нашему серверу. Здесь можно исправить имеющиеся у нас проблемы, например внести корректировки в файлы sudo. После внесения нужных правок система может быть загружена обычным образом (все сделанные нами ранее изменения в GRUB были временными).

Дополнительные источники информации:

Проверено на следующих конфигурациях:

Автор первичной редакции:
Алексей Максимов
Время публикации: 13. 2018 15:45

What Is The Root Password For Kali Linux?

Let’s see if you can disable root login for Linux using n root login in Linux for SSH Well, you can do that by simply editing the /etc/ssh/sshd_config file and disable root login from there. In default mode, it prohibits password logging on any given basis and only allows access to the Keys on that basis.

What Is The Default Password For Kali Linux 2020?

Enable root login over SSH: As root, edit the sshd_config file in /etc/ssh/sshd_config : nano /etc/ssh/sshd_config. Add a line in the Authentication section of the file that says PermitRootLogin yes. Save the updated /etc/ssh/sshd_config file. Restart the SSH server: service sshd restart.

How do I bypass root password in Linux?

As said above, the root account is locked by default. This means the emergency mode doesn’t work out of the box. – Open a terminal and create a directory (let’s call it hdd here. ) You can then reboot the installed OS get back into emergency mode and type the root password to start troubleshooting.

How do I know if SSH is enabled?

To check if the client is available on your Linux-based system, you will need to: Load an SSH terminal. You can either search for “terminal” or press CTRL + ALT + T on your keyboard. Type in ssh and press Enter in the terminal. If the client is installed, you will receive a response that looks like this:.

Where is root password stored Linux?

How do I find my sudo password?

Can you disable root in Linux?

How do I change my Vrops admin password?

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,335,921 times.

Conclusion

I am surprised and somewhat dismayed by this situation — all of it. The error itself, the inability
to debug live, the fact this happened to me after a Fedora upgrade (again), the fact I ended up with an
unbootable distro after ordinary system activities, the overall complexity of systemd. All of
these leave me with a sense of unease.

How do I open the console root?

To view your certificates in the MMC snap-in, select Console Root in the left pane, then expand Certificates (Local Computer). A list of directories for each type of certificate appears. From each certificate directory, you can view, export, import, and delete its certificates.

Оцените статью
Master Hi-technology
Добавить комментарий