What to do if you forget the root password in CentOS7

change Password

--Enter edit mode on the GRUB2 startup screen

Press e on the kernel selection screen to enter edit mode

cent のクローン [実行中] - Oracle VM VirtualBox 2020-10-23.png

--Make changes in edit mode

Delete the rhgb quiet LANG = ja_JP.UTF-8 on the line starting with linux16

1cent のクローン [実行中] - Oracle VM VirtualBox 2020-10-23.png

--Add to the deleted place

Add rw init = / bin / sh to the deleted location. After adding it, start it with Ctrl + x.

2cent のクローン [実行中] - Oracle VM VirtualBox 2020-10-23.png

--Change to new password

When the console starts, change the root password using the following command.

# passwd

I'm angry here that the password is less than 7 characters, but I was able to change it.

If you can change the password, start it as follows.

# exec /sbin/init

3cent のクローン [実行中] - Oracle VM VirtualBox 2020-10-23.png

--Login

After booting, log in with the new root password.

4cent のクローン [実行中] - Oracle VM VirtualBox 2020-10-23.png

reference

-How to change root user password in CentOS7 [Old single user mode]

Recommended Posts

What to do if you forget the root password in CentOS7
What to do if you can't use the rails command
What to do if you can't get the text of an element in Selenium
What to do if you install Ubuntu
What to do if Cloud9 is full in the Rails tutorial
What to do if you cannot roll back the migration (UnknownMigrationVersionError)
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do if the server tomcat dies
What to do if you push incorrect information
What to do if you get a groovy warning in Thymeleaf Layout
What to do if the prefix c is not bound in JSP
What to do if you don't like the code generated by swagger-codegen-cli
What to do if the debug gem installation fails
What to do if the Rails server can't start
What to do if you get the error message unrecognized selector send to instance "***"
What to do if the changes are not reflected in the jar manifest file
What to do if you accidentally create a model
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
If you want to recreate the instance in cloud9
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you get a wrong number of arguments error in binding.pry
What to do if you get the error Couldn't find Item without an ID
What to do if you cannot execute with the command "Java package name / class name"
# What to do if you accidentally do rails db: migrate: drop
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
What to do if you can't find the JDK you put in SDKMAN after migrating from bash to zsh on macOS
What to do if you change the Listen Address from the settings screen with Mattermost docker
What to do if you installed Ruby with rbenv but the version does not change
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a "302" error in your controller unit test code in Rails
What you need to do to open a file from the menu in the document-Based App macOS app
What to do if you get an error in Basic authentication during Rails test code
[Ubuntu 20.04] What to do if the external monitor is not recognized
What to do if validation doesn't work with the update action
[Rails] What to do if data is not registered in DB
What to do when the changes in the Servlet are not reflected
If you want to include the parent class in Lombok's @builder
What to do if the Eclipse Maven dependency Jar is wrong
What to do if you get angry with OpenSSL with pyenv install
[Rails] What to do if you can't get parameters with form_with
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do when you want to know the source position where the method is defined in binding.pry
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
What to do if you get an error during rails db: reset
[Composer] [Laravel] What to do if you cannot install due to insufficient memory
What to do if you get an uninitialized constant Likes Controller error
What to do if tomcat process remains when tomcat is stopped in eclipse
What to do if you get an error when you hit Heroku logs
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What do you use when converting to String?
What to do when IllegalStateException occurs in PlayFramework