• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

AI, Linux, Cloud and DevOps

  • Home
  • Resources
    • Learn Linux
    • Articles
  • My Projects & Work
    • My Nagios Plugin
    • My Dockerhub Repo
    • My WordPress plugins
    • My Github Repos
  • Facebook Page
  • Contact
  • Privacy Policy
  • About Me
You are here: Home / Articles / Password prompt in single user mode is not secure : CentOS/Red Hat

Password prompt in single user mode is not secure : CentOS/Red Hat

January 8, 2014 by Sharad Chhetri Leave a Comment

In this post I will discuss about, how a person still can log into Single User mode even if you have secure the single user mode.We can still login into system even if you are getting password prompt in single user mode / runlevel 1.The practical has been done in CentOS 6.x and Red Hat 6.x.
In some articles you may have read about securing root access in single user mode.In which System Admin do editing in /etc/sysconfig/init file and write SINGLE=/sbin/sulogin whereas it disable sushell by giving comment on the line #SINGLE=/sbin/sushell .After this when we restart the system,we also see in Single User Mode it is asking Root password and believe that Single User mode is safe.( See the given below screenshot)

runlevel 1

NOTE: Red Hat do not recommend this. As per Red Hat recommendation we can secure root access by putting grub password.

Follow the steps to know,how you can still access in single usermode with root password even SINGLE=/sbin/sulogin has been implemented.

Requirement: No CD/DVD/USB or extra media required
Condition: GRUB password should not be set

Step 1: Restart the system and go to single user mode or runlevel.Read my previous post about how to reset root password in runlevel 1 .
Follow our previous post and reach up to Step 4

See below screen shot,when system reach to this screen.With the arrow key,select the line starting with kernel /vmlinuz-.Now press “e” from your keyboard to edit.

runlevel1

Step 2: Now we will add the command in line as given below after typing press ENTER.See the screenshot (only type given below command after giving a space)

init=/bin/bash

runlevel 1 root passwd

Step 3: After pressing ENTER key,you will be back to previous screen. Now press the key “b” to boot the system

System will be booted and directly login with user root in runlevel 1,without giving any password. But the system will not allow you to edit any file because it is in read only mode.

Now terminal now run the command


mount -o remount,rw /

See the below given screenshot for reference

runlevel 1 root password

Step 4: Now reset the root password and give new password

passwd root

Step 5: This step is optional. If you want to remove the Password prompt in runlevel 1/Single User mode. Edit 2 lines in the /etc/sysconfig/init file as given below.

vi /etc/sysconfig/init

Locate the line having parameter as SINGLE=/sbin/sulogin. Comment this line like this #SINGLE=/sbin/sulogin . (to comment use # sign in starting of the line, see given below screenshot)

And uncomment the line, SINGLE=/sbin/sushell (Remove # sign in starting of the line,to uncomment )

runlevel 1 root password

Save and exit the file. (In vi editor for save and exit, use keys, ESC : wq! and hit enter)

Step 6: Now reboot the system by using Magic Sysreq. If you are trying to reboot the system by init,shutdown or reboot command.The system will not reboot,it will show error or might be hanged)

echo b > /proc/sysrq-trigger

The system will be rebooted.

Step 7: Now check the new root password in runlevel 1. If you have followed Step 5 then also check the password prompt in Runlevel 1.Because we edited the /etc/sysconfig/init file,it will not ask for password prompt in runlevel 1

Share this:

  • Share on X (Opens in new window) X
  • Share on Facebook (Opens in new window) Facebook
  • More
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon

Articles

create and delete user in Red Hat and CentOS
How to create own Git Server with Gitolite and Gitweb in Ubuntu
How to install apache webserver in CentOS and Red Hat
How to install nginx webserver from source on CentOS and RHEL
How to configure vsftpd server with virtual user mysql authentication in CentOS 6
Install and configure rsyslog Centralized logging server in CentOS 6.5
Find installed and enabled apache module in Debian/Ubuntu
Essential Linux Commands Every Beginner Should Know | With Examples
What is Runlevel in Linux
How to configure multiple mysql instance in Ubuntu
Recover Linux Grub Password in linux rescue mode CentOS/Red Hat
Setup Master Slave Chroot BIND DNS in CentOS 6 or Red Hat 6
Install latest wordpress in CentOS 6
Set GRUB password after installation of CentOS/Red Hat
How to install own git server with ssh and http access by using gitolite and gitweb in CentOS

Filed Under: Articles, Tips And Tricks Tagged With: forgot root password, runlevel, single user mode

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Articles

  • Install n8n docker in Ubuntu for practicing
  • Bash Script: MySQL Database backup to AWS S3
  • Automate no touch Jenkins setup wizard on docker (jcac)
  • How to run and configure Jenkins in Docker container
  • Complete Guide: How to install Nagios Monitoring on AlmaLinux / Rocky Linux
  • Install KVM on Ubuntu 24.04 LTS ( Bash Script )
  • How to install GIMP 2.10 on Ubuntu / Debian
  • 5 ways to check Ubuntu version of system (commands and GUI)
  • How To Solve Forgot MySQL / MariaDB Root Password
  • Create Self Hosted Build Agent Docker Image for Azure DevOps

Copyright © 2026 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From India.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy