In CentOS 6.0, we can change the root password even if we don't know it (or if we forgot that password).
This is the method:
- At the boot loader menu, press "e" to edit the kernel
- Select the second line (it begins with the word kernel)
- Edit the line by pressing "e"
- At the end of this line, add the word "single", without quotes
- Exit out of this line by pressing enter
- Boot the kernel while having that line highlighted by pressing "b"
It will boot into single user mode
- Type "passwd", without quotes, and it will prompt you for a new password
- Enter your new root password and login.
Suppose if any normal user changes the root password with this method, then other users will be affected (if server is hacked).
Then how is Linux secure?