Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

  1. At the boot loader menu, press "e" to edit the kernel
  2. Select the second line (it begins with the word kernel)
  3. Edit the line by pressing "e"
  4. At the end of this line, add the word "single", without quotes
  5. Exit out of this line by pressing enter
  6. Boot the kernel while having that line highlighted by pressing "b"
    It will boot into single user mode
  7. Type "passwd", without quotes, and it will prompt you for a new password
  8. 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?

share|improve this question
2  
Do you know any OS that is secure against an "attacker" with physical access without full disk encryption? –  Mat May 28 '12 at 8:46
    
See en.wikipedia.org/wiki/Physical_access: "for instance, pressing F8 while certain versions of Microsoft Windows are booting, … editing the command line in GRUB". Also support.microsoft.com/kb/818200 –  RedGrittyBrick May 28 '12 at 8:59
add comment

1 Answer

up vote 7 down vote accepted

The assumption is that if you have physical access to the machine, then the machine can be compromised.

That being said, you can either password-protect the Grub boot loader, or password-protect the single-user mode. You'd also need to password-protect the BIOS to prevent people from booting from USB and then accessing the partitions directly, and also, to go further, disable Control-Alt-Delete in /etc/inittab (or /etc/systemd/system/ctrl-alt-del.target in newer systems using SystemD).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.