← Back to list

How to boot into single user mode of CentOS 7.* to edit some file when you forget root’s password

When you forget the password of root using the CentOS 7.*, there is a way to get in the system in the “single user mode”.

Ta荐 · 2025-10-03 01:28 · 0 claps · 0.6 min read
#centos7 #forgot-password
Open on Medium ↗

How to boot into single user mode of CentOS 7.* to edit some file when you forget root’s password

When you forget the password of root using the CentOS 7.*, there is a way to get in the system in the “single user mode”.

Here are steps:

  • As the system boots, press Esc to bring up the GRUB boot prompt.
  • At the GRUB boot prompt, press E to edit the first boot option.
  • Find the kernel line starting with linux16, Change ro to rw init=/sysroot/bin/sh.
  • Press Ctrl+X or F10 to boot into single user mode.
  • Access the system with the command: chroot /sysroot.
  • Do anything you like.
  • Run exit to exit sysroot.
  • Run reboot -f to reboot the server.

메타데이터
post_id
a94dcbe83405
slug
oshow-to-boot-into-single-user-mode-of-centos-7-a94dcbe83405
url
https://medium.com/@tajian-tv/oshow-to-boot-into-single-user-mode-of-centos-7-a94dcbe83405
canonical_url
https://medium.com/@tajian-tv/oshow-to-boot-into-single-user-mode-of-centos-7-a94dcbe83405
author_url
https://medium.com/@tajian-tv
status
ok
fetched_at
2026-07-26 22:32:07