Change root password. Resetting the root password in Linux is the first way. Change the Linux user's password and set its expiration date.

Reset root password on Linux. Sometimes you may need to reset your password, for example, after vacation, you forgot it, lost it, or in other cases. To reset your password, you must have physical access to your computer.

There are two main ways to reset your password by having physical access to the computer on which you need to reset the password.

There is an easy way to reset your password. Recovery mode is often used when you need to perform file system maintenance and repair, or conduct vulnerability audits in an isolated environment. Select "recovery menu" by pressing the arrow key.

Change Linux user password and set its validity time

Did you find this guide helpful? Step 1: Log in with the system username. For example, here the user's system name is charade. First, provide the password of the system user with which you log in. Click and confirm the password. Note. When we set a user's password, it is always invisible.

Resetting the root password in Linux is the first way:

Through gRUB bootloader ... If you have a bootloader installed and you have access to it, then follow these steps:


After rebooting, at the moment the GRUB bootloader menu appears on the screen, select the operating system and press " e".

Below is the link from my system. User management is an important part of maintaining a secure system. Inefficient user and privilege management often leads to the failure of many systems. He just got a password that doesn't match the possible encrypted value, so it might not log in by itself.

This means that all users can view and access the contents of other users' home directories. It may not be suitable for your environment. Only one parent directory is sufficient to prevent unauthorized access to everything below the parent. Many successful security breaches involve simple brute force and dictionary attacks against weak passwords.


Next, we find the line that starts with linux (linux16, linuxefi), at the end of this line we look for ro (readonly), changes to rw (read and write) and add init \u003d / bin / bash... If the disk is encrypted, then you need to add plymouth.enable \u003d 0... All these changes are valid only in this session, after a reboot they will be lost.

If you intend to offer any form remote access using your local password system, make sure you adequately meet the requirements for minimum password complexity, maximum password expiration times, and frequent checks on authentication systems. This way, you ensure that local fallback authentication is not possible. Usually it appears automatically, if not, then hold down the shift key until the boot menu appears.

It will display a black screen with multiple lines of output to be displayed in flash mode. You will now have different options for recovery mode. Use the following command to display a list of all available users.


Push F10 or Ctrl + x and load command line.

Enter a new password using the passwd command:

[email protected](none): / # passwd


We enter a new password, repeat and if we see the following error: passwd: Authentication token manipulation error - this means the directory is read-only (see "ro" above). This can be corrected by the following review, we write:

From the previous command select the "username" for which you want to reset or crack the password. Now use the following command to reset the password for the selected "username". You just hacked it and now you can easily login.

When entering a new password, you can ask for an authentication manipulation error, for example. The reason for this error is that the file system is mounted read-only. Change access and remount file system in the following way.

Now try resetting your password again. To do this, enter the following command. Make sure you enter the ampersand at the end of the command. ... From the very beginning of computers, they have always been protected by some sort of password to keep the data inside the computer safe and secure.

[email protected](none): / # mount -n -o remount, rw /

Let's repeat the command to change the password:

[email protected](none): / # passwd

After entering the new password, we will see in response: passwd: password updated successfully... - this means that the new password has been accepted.


Restart your computer:

[email protected](none): / # / sbin / reboot -f

That's it, boot as usual and enter our new password.

The above action will open up additional options; Here select "recovery mode" to open the recovery menu. The above action will open the command line interface. Here enter the following command and press the Enter button. What this command does is that it remounts the filesystem with write permission.

After you replace the username, the command looks something like this. Just enter the new password twice and you will receive a confirmation message “password updated successfully”. When you are finished changing your password, enter the command. And press enter button to return to recovery menu.

Resetting root password in Linux is the second way:

The second way, more clumsy and less desirable, is with LiveCD any linux distribution ... To do this, download a LiveCD, for example Fedora:

We open file manager, go to the "Other Lacations" tab, look for where the root section of our Debian system is located, in the root section there should be an etc folder, and in the etc folder there should be a shadow file in which all our passwords are stored. In my case, this is / dev / sda1.

You may receive a warning message similar to the one below; Nothing fancy, just press the Enter button to restart your computer. The local user has the same password as you. Log in and change your password to something else. Single Player: This was only explained by Renan. Some bootloader configurations require a password to do this, and you should know to proceed. It says which one is at the bottom of the screen. ... Your system will boot into single user mode.

Install the root. ... You also have no control over the assignments, so be careful with what you type. One misplaced cat and you might have to reboot if you can't get out of it. Rescue disc: it's easy. Load a rescue disk of your choice.

After that, you need to select the etc folder and right-click to open its properties. Find and copy the full path to this folder there.


Then open a terminal, use the su command to go under root.

We write the cd command and paste the copied path, go to root directory Debian.

Obviously, there are many variations of the above. They all boil down to two steps. There are many reasons why you might want to reset your password. First, you must reboot into recovery mode. From the boot menu, select the recovery mode, which is usually the second boot option.

How to change group password

After you select the recovery mode and wait for all boot processes to complete, you will be presented with several options. If you forgot your username, enter. Where username is the username you want to reset.


Open the shadow file with any text editor.

In the shadow file, find the line starting with root and delete the password hash, as shown in the screenshot below.


Save our file, restart your computer and take out the Fedora LiveCD.

You will then be prompted for a new password. When you enter a password, you will not get a visual response that confirms your typing. Your password is still being accepted. You will be prompted for a password. The password should now be reset. To return to the recovery menu.

Password change error

This will change the password to be blank. You will receive an error that you cannot change your password. To fix this, remount the disk in read mode - write mode. If you are installing this on a desktop computer, you will need to open a terminal in order to run the following command. Since the server has no GUI by default, you just need to enter the command.


We load our Debian, in the username field enter root, and the password field leave blank and click "Login".

We open a terminal, enter the passwd command and change our root password.


That's all, the password has been changed.

So, we type the command

Councils for opening the terminal. Enter your password. Trigger level 1 can be used as a rescue mode. If you have more than one encrypted section and they all share a global passphrase, select the option for the global passphrase. Otherwise, enter the password pair separately for each section.

You can reboot the machine with. Create a directory where you can mount your installation's filesystem. Set the filesystem for your installation. ... If the current password is entered correctly, a new password is requested. The new password must be entered twice to avoid typing errors.

It is sufficiently protected - not only from outside penetration, but also from imprudent actions of the user. One of the tools for such protection is the passphrase root. A complex and reliable access key is easy to forget if you do not use a computer for a while. We suggest using a password reset, Ubuntu contains the tools you need to do this.

A note on protecting your password

Therefore, you need to protect your password.

  • Do not write down your password.
  • A mix of uppercase and lowercase letters, as well as numbers or punctuation marks.
  • The length is at least 8 characters.
Use a personal password manager to store all passwords in a secure, encrypted file.

Objective: set or change user password

This password is then encrypted and compared with the stored password. The user has only one chance to enter the correct password. The superuser is allowed to bypass this step so that forgotten passwords can be changed. The new password is checked for complexity. As a general guideline, passwords should be 6-8 characters long, including one or more of the following sets.

There are two ways to change your password.

There are a couple of ways to restore access to computer resources. In Ubuntu, the default root password can be "reset" through the GRUB bootloader, or by liveCD help... Any distribution will do, but it is advisable to use the native one.

Lower case alphabets Selected letters in alphabetical order 0-degree digits 9 Publications. The current group password is not requested. This allows group access to all members. Run the following command. Requires an ampersand at the end of the command.

Run the following commands. Then you have a serious problem. If this is done, you will have full access to your computer's data. Passwords are encrypted, however, so use little in this case. The only way to work with your computer again is to remove the password. This allows you to start the original system, log in without a password, and then immediately set a new password.

Method number 1

This option will help a lot when you have access to boot options. For those who, after not using Ubuntu for a long time, have forgotten their password, you can do this.

At the time of restarting the computer, select the required OS in the boot list and press "E". On the next screen, in the boot configuration, find the line at the beginning of which is the word "linux". At its end, replace the combination of letters "ro" with "rw". After that add to the line

Method 2: Start with the installation media

The line between the first and second colon is the encrypted password. This line should be removed; Just leave everything else as it is. The line looks like this after the change. In practice, no password is required for this. In this article, we will show you how to set a new password using these methods.

Method 3: start single user mode

One of the possibilities is single-user mode.

However, on standard systems, there are several ways to remove or change forgotten password... This prevents unauthorized access to personal data and also protects the system from inadvertent changes to other user accounts.

The combination that we changed will allow not only reading files, but also writing in random order. When the root password is reset, Ubuntu and the bootloader will return to their original state. Load command line. To do this, you can press "Ctrl + X". Enter a new passphrase. This requires the following command:

Reset administrator or user password

However, if you forgot your password, it no longer comes in the system. If you need administrator rights, for example, when setting up a new software the user password must be entered. It is sometimes difficult to find the right time for this. If some kernel updates are installed, enter the entry with the highest version number. Here you can find out how user accounts are configured. This is useful if you don't remember the exact spelling of the username. Before you can make any changes, first run Command Prompt.

In Ubuntu, the default password has not changed and an error has occurred - this means that the required directories are still not writable. Type the following:

[email protected](none): / # mount -n -o remount, rw /

Then reissue the passwd command. You should see a message stating that the data has been successfully modified.


This will allow you to mount the root filesystem with write access. The long line behind the username is the encrypted password. The last two fields between double dots are populated when expired account user.

Now you can simply remove the password in the editor. Then the line might look like this. Password reset: Instead of deleting the password, you can also assign it again. Then you must enter the new password again. Finally, enter the next three lines. This ensures that the changes are actually written to disk. If you have removed your password, just click Sign In. Enter a new password and confirmation. To go unnoticed, an unauthorized person probably won't change the password as described in this article.

Restart your PC:

[email protected](none): / # / sbin / reboot -f

Everything! We were able to change the Ubuntu password. You can now log in again.

Method number 2

In this case, you will again have to deal with the OS selection parameters. Find recovery mode in the startup menu. We'll start resetting the Ubuntu passphrase from here. Do you have the same OS? To start GRUB, hold down Shift while starting. Alternatively, press the Reset button at boot and the next time GRUB appears on startup.

Enter recovery mode, which makes it easier to reset the root password in Ubuntu. You should be watching a rooted console. Put the file system in write mode, by analogy with the First method. Another command can be used here:


To change the root password in Ubuntu, simply type:

passwd username

Here "username" is the name of your account.

Run the command to restart your computer:

In conclusion

You have learned from examples how you can change a user's password in Ubuntu. This seemingly difficult task turned out to be easier than you thought, didn't it? If you have additional questions about software for Ubuntu, we recommend that you familiarize yourself with other materials on our website. Join the discussion of current programs and hardware on the pages of our site!