In linux, how can I re-obtain the lost password? in linux, if I forget the user password, it will be very troublesome and difficult to re-obtain it. You can reset the user's password for ELE. Me using the following method: first, we will introduce the linux Account creation/deletion command useradd username -- add a user to generate a corresponding folder named passwd username under the home Directory -- add a password for the username user, if the parameter "username" is not specified, the password userdel username is set for the current user -- delete the user, but do not delete the user's corresponding folder userdel-r username -- delete the user and its corresponding folder. In addition, we will introduce several linux running levels in linux. There are 7 running levels in linux, which are: 0: shutdown ---- In this mode, the system will shut down once it is started. 1: Single User www.2cto.com 2: multiple users without network 3: multiple users with network (most commonly used) 4: The system is not used, retained to user 5: graphic interface starts up and enters graphical interface 6: The system restarts after the system is started Note: two red running modes (3 and 5) it is a common method to modify the default running level. You can modify the id: 5: initdefault: in the/etc/inittab file to reset the password for this line. (red hat is used as an example, other systems are not necessarily feasible) (1) when the boot enters the boot interface, click 'E', 1 in the boot program (grub in redhat)
Figure 1 then enters the following interface, as shown in Figure 2:
Figure 2 (2) Select the second row and then enter an e
Figure 3 (3) Select the second row and then enter an e
Figure 4 enter the modification page, enter 1, and press Enter. Note that there is a space between/and 1. This 1 represents the 1 (single-user-level] user-level www.2cto.com (4) then press B to enter the single-user mode.
Figure 5 after entering the Level 1, you can change the passwd username Password again. At this time, the system does not require the old password. The new password is set here. Finally, by setting the default running level to 3 or 5, the password is the principle of the new password upon restart: in linux, it will be read first at startup. the parameter set in/etc/inittab will skip this process only when the 1st [single user] level is set. after entering the system, you can change the user password, finally, you can set the running level back. To modify the default running level, you can modify the id: 5: initdefault in the/etc/inittab file.