Root Password
Reset
Breaking your root
password to access the
root user
2
“ I have forgotten my root password!
How can i do to access my root user
commands?
3
How to reset your root
password
⬡ The root password is the one you use when you run
the$ sucommand on your system
⬡ If you don’t know or you can’t remember that
password, you will not be ableto access
thesuperuser(root) commands
⬡ Thus you will just run regular user commands
4
“
5
Trust me, this situation
constantly occurs.
Let’s learn how we can recover
or set a new root password!
Exercise
You have forgotten your root password
and you want to run a root command.
Reset the root password.
NB:The new password must be
Password01
6
⬡ Firstly, we need toshutdown
the server
Hope you remember how to do
that in VirtualBox!
⬡ Click on the button to close the
window (follow the steps 1 and
2)
How to reset the root password
?
7
⬡ Now,boot upthe server, wait
patiently not to miss the
countdown.Be ready on the
keyboard
⬡ As soon as you see the following
screen, press the key “e” on the
keyboard
NB:If you miss the countdown, you
can turn off the server and start it
back
How to reset the root password
?
8
⬡ Use the down arrow to look for the line starting withlinux16
⬡ Then use theright arrow keyto move to the end of the line
⬡ Put a space and typerd.break
⬡ Hold theCtrlkey and pressx (Ctrl-x)
How to reset the root password
?
9
⬡ The page will refresh and present the following lines with the#sign at the
end
How to reset the root password
?
10
⬡ Now we need to mount the root file system (sysroot). Run the following
commands successively. Don’t forget to pressEnterat the end of each!
∙ # mount -o remount,rw /sysroot
∙ # chroot /sysroot
∙ # passwd root
⬡ Enter the new password that isPassword01
⬡ Retype the same password for confirmation.
How to reset the root password
?
11
The command we typed previously completely removed theselinux context.
We need to reset it by creating a specific file. To do that, run:
⬡ # touch /.autorelabel
Now exit twice to logout
⬡ # exit
⬡ # exit
The system willreboot itself. This might take some few minutes (It might be
faster depending on your computer)
How to reset the root password
?
12
13
What is SElinux
?
Security-Enhanced
Linux(SElinux) is a security
feature in linux systems that
monitors system accesses.
When that is done, login with the user student and open a terminal
Try the$ sucommand and type the new password
How to reset the root password
?
14
15
Place your screenshot here
When that is done, login
with the user student and
open a terminal
Try the$ sucommand and
type the new password
How to reset the root password
?
“
😉
16
Practise this on one of your
servers and find out if you are
able to break into your system
See you guys in the next
lesson!
17
Thanks!
Any questions?
You can find me at:
website:abdasmarttechsolutionsllc.com
Phone: +1 (612)249-3623
Email:abda-smarttech@solutions.com

5-1 Root-password-reset_updated_corrected_varied_text.pptx

  • 1.
  • 2.
    Breaking your root passwordto access the root user 2
  • 3.
    “ I haveforgotten my root password! How can i do to access my root user commands? 3
  • 4.
    How to resetyour root password ⬡ The root password is the one you use when you run the$ sucommand on your system ⬡ If you don’t know or you can’t remember that password, you will not be ableto access thesuperuser(root) commands ⬡ Thus you will just run regular user commands 4
  • 5.
    “ 5 Trust me, thissituation constantly occurs. Let’s learn how we can recover or set a new root password!
  • 6.
    Exercise You have forgottenyour root password and you want to run a root command. Reset the root password. NB:The new password must be Password01 6
  • 7.
    ⬡ Firstly, weneed toshutdown the server Hope you remember how to do that in VirtualBox! ⬡ Click on the button to close the window (follow the steps 1 and 2) How to reset the root password ? 7
  • 8.
    ⬡ Now,boot uptheserver, wait patiently not to miss the countdown.Be ready on the keyboard ⬡ As soon as you see the following screen, press the key “e” on the keyboard NB:If you miss the countdown, you can turn off the server and start it back How to reset the root password ? 8
  • 9.
    ⬡ Use thedown arrow to look for the line starting withlinux16 ⬡ Then use theright arrow keyto move to the end of the line ⬡ Put a space and typerd.break ⬡ Hold theCtrlkey and pressx (Ctrl-x) How to reset the root password ? 9
  • 10.
    ⬡ The pagewill refresh and present the following lines with the#sign at the end How to reset the root password ? 10
  • 11.
    ⬡ Now weneed to mount the root file system (sysroot). Run the following commands successively. Don’t forget to pressEnterat the end of each! ∙ # mount -o remount,rw /sysroot ∙ # chroot /sysroot ∙ # passwd root ⬡ Enter the new password that isPassword01 ⬡ Retype the same password for confirmation. How to reset the root password ? 11
  • 12.
    The command wetyped previously completely removed theselinux context. We need to reset it by creating a specific file. To do that, run: ⬡ # touch /.autorelabel Now exit twice to logout ⬡ # exit ⬡ # exit The system willreboot itself. This might take some few minutes (It might be faster depending on your computer) How to reset the root password ? 12
  • 13.
    13 What is SElinux ? Security-Enhanced Linux(SElinux)is a security feature in linux systems that monitors system accesses.
  • 14.
    When that isdone, login with the user student and open a terminal Try the$ sucommand and type the new password How to reset the root password ? 14
  • 15.
    15 Place your screenshothere When that is done, login with the user student and open a terminal Try the$ sucommand and type the new password How to reset the root password ?
  • 16.
    “ 😉 16 Practise this onone of your servers and find out if you are able to break into your system See you guys in the next lesson!
  • 17.
    17 Thanks! Any questions? You canfind me at: website:abdasmarttechsolutionsllc.com Phone: +1 (612)249-3623 Email:abda-smarttech@solutions.com