Manually modify the user password in/etc/shadow and/etc/passwd

Source: Internet
Author: User
Tags delete key md5 encryption
1. Manually modify the user password in the/etc/shadow

/etc/shadow file

First field: User name (also known as login), in/etc/shadow, username and/etc/passwd are the same, so that the passwd and shadow use of the user records are linked together; this field is non-empty;
Second field: password (encrypted), this field is non-empty;
Third field: The time when the password was last modified, which is the time interval (days) from January 01, 1970 to the most recent password change, you can modify the user's password by passwd, and then view the changes in the field in/etc/shadow;
The fourth field: two times to modify the password interval at least; If the value of this field is blank, the account number is permanently available;

Fifth field: two times to modify the password interval maximum number of days; If the value of this field is blank, the account is permanently available;

Sixth field: The number of days in advance warning user password will expire, if the value of this field is blank, the account is permanently available;

Seventh field: How many days after the password expires, disable this user, and if the value of this field is blank, the account is permanently available;

Eighth field: User expiration date; This field specifies the number of days that a user is invalidated (from the number of days from January 1 of 1970), and if the value of this field is blank, the account is permanently available;
Nineth field: Reserved field, currently empty, for future development;

The/etc/shadow format is as follows
#testaccount: $1$acqmcef9 $1sacpg2qikka3egolu4fp0:13402:0:99999:7::
Color segment is encrypted password, $1$ means to use MD5 encryption, green segment is a simple string, blue segment is encrypted password



Once you delete $1$acqmcef9$1sacpg2qikka3egolu4fp0 it, you delete the password

2.linux forgot login Password modification/etc/passwd can also

It's a simple trick to introduce
Press any key at this interface
Press E (start before editing the command)
Select the second item by pressing the E key (modify the selected command at startup)
Enter single (note space) into Single-user mode
Select B to Start
Input VI/ETC/PASSWD
Root:x:0:0:root:/root:/bin/bash
Move the cursor to X, press the DELETE key to delete it
Input: X.
Enter reboot reboot
When you reboot, you'll find that you haven't lost your password, deciphering success.

Principle Explanation:
The user's information file is stored in the/etc/passwd file Root:x:0:0:administrator:/root:/bin/bash

In this sentence

Root is the user name,

X is the password mark, just explain the location of the password, the specific is placed in the/etc/passwd of the password do not think all of the cipher is saved, can not understand

0 User ID Number

0 Group ID Number

The administrator estimated that I was installing the system, the original name did not change (virtual machine default username), is the meaning of user instructions,

Home directory of root users

/bin/bash records the permissions that users have when they log on, that is, the shell they own.

So, after we delete the code, there will be no dialog box to ask for your password.

Of course

Grub is a boot loader that can be set to a password

But set the password we can light, with the installation of the CD into Safe mode, in the password to clear

The BIOS password can be set by the light,

The BIOS password can be removed from the chassis buckle battery

So the legendary Linux is not very safe, generally speaking of security is based on the network, meaning that Internet access, the other side through the network to invade your Linux computer is very difficult, this method of deciphering is just in case, in the case of you forget the password when used, as for physical security, It depends on how you protect it.



This article is reproduced in: http://blog.chinaunix.net/uid-15797451-id-3041560.html

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.