Linux Password war-general Linux technology-Linux technology and application information. For more information, see the following section. I am a beginner in linux. After installing the system on a virtual machine, I think about how to protect and change the password:
Part 1: how to change the root password.
After linux is installed, there will be a root user. So how can I change the root user password without knowing the password?
In this system, the RedHat Linux installation environment is vmware 6.0 guided by GRUB.
The method is as follows:
1. Press "e" on the grub boot interface to enter the grub editing mode.
2. Select the second option in edit mode, that is, "kernel/vmlinuz-2.4.20-8 ro root = LABEL = /". Then press "e" to edit this item.
3. Add "single" to the end (Note: There is a space in front ). Press enter and then press "B" to start the linux single-user mode.
4. Because it is in single-user mode, no password is required. After the boot is complete, at the prompt (note that the prompt is like sh-2.05b #, not the previous prompt) input: "passwd root" (passwd is the command to change the user password .). Then, modify the password as prompted. (Sometimes the system prompts bad password. It doesn't matter. The reason is that the password is too simple or a common word .)
5. Restart and enter normally. OK. The root password has been modified.
Part 2: prevent others from modifying their passwords in single-user mode.
To guide the single-user mode, you must edit it in grub. Therefore, we only need to encrypt grub and prevent others from modifying grub.
The method is as follows:
1. grub has a configuration file in the/etc folder. The name is "grub. conf". Locate the file and use vi to edit it.
2. Let's take a look at the content in the file: (annotations are skipped)
Default = 0
Timeout = 10
Splashimage = (hd0, 0)/grub/splash.xpm.gz
Title Red Hat Linux (2.4.20-8)
Root (hd0, 0)
Kernel/vmlinuz-2.4.20-8 ro root = LABEL =/
Initrd/initrd-2.4.20-8.img
For more information, see the grub documentation. Here we will add a password.
You can add a password in two places.
3. Add "password = 123456" (123456 is your password) under "timeout = 10 ). Save, exit, and restart. We can see that the grub interface cannot be modified by "e. To modify the password, press "p" to enter the password.
4. The second place is under "initrd/initrd-2.4.20-8.img. Add "password = 123456" here (123456 is your password ). Save, exit, and restart. We can see that there is another password before linux is started (after the grub interface. It is worth noting that this password can prevent entry in single-user mode. That is to say, even if we start the single-user mode by editing grub, we still need to enter this password.
Part 3: how to crack the grub Password and obtain user permissions.
To obtain the grub Password, we have to find a way to read the grub. conf file. But there is no grub Password, no root password... Therefore, we cannot boot through grub.
The method is as follows:
1. First, you need to modify the VM startup mode. We need to start the VM from the CD. By default, virtual machines use the hard disk as the first boot mode.
When the virtual machine is started (the big "vmware" Interface), immediately press "F2" to enter the bios.
2. Select the boot column. Select the CD-ROM Drive item and press + to upgrade the CD-ROM Drive to the top. In this way, the first boot mode is enabled by default.
3. Bind The first installation disk image of linux to the optical drive, save it, and restart it. The system directly enters the installation interface of linux. Enter "linux rescue" at the prompt and press Enter. The system will start the linux rescue mode.
4. There are several options on the way, just select as prompted. Finally, we will see a description, which means that the rescue system mounts the original system file (the one on the hard disk) to the "/mnt/sysimage" folder.
5. After starting, we can find the grub. conf file. Note the structure of the folder: we are now in the root directory of the rescue system. We are looking for the "/etc/grub. conf" of the original system, so the complete path is: "/mnt/sysimage/etc/grub. conf ". You can use vi to edit the file and modify it. To crack the grub Password.
Part 4: How to prevent others from guiding to the linux rescue mode.
We can see that the bios must be modified to boot to the rescue mode. Then, we can encrypt the bios to prevent others from modifying the bios and thus cannot boot from the disc.
The method is as follows:
This is relatively simple. After entering the bios, select "Security. Press enter on "Set Supervisor Password. Set the password. In this way. We need a password when restarting the system and entering the bios again.
Part 5: how to crack the bios password.
What methods do we usually use to clear the host bios password? Unplug the Jumper and swap the battery to restore the bios settings. Is there a similar method on a virtual machine?
The method is as follows:
Find the folder where the VM is located. There should be a file with the suffix ". nvram. Delete this file. Start the system. We can see that. The bios is reset.
Part 6 and follow-up: prevent others from deleting files.
This part already belongs to windows and will not be described. What I want to say here is that too much reliance on technology will only make the system more and more complex, and too many passwords have already placed a great burden on us. Moreover, there is no absolutely secure system, and the final solution still requires people to consciously abide by the rules.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service