Use the following command to see the content of /etc/passwd: cat /etc/passwd The first is /etc/passwd, which contains all the users’ information, including the encrypted password, group ID, and home directory. Password management in Linux involves two important files. Now that the user edward has the same password as user leon, use the passwd command to set a new one: sudo passwd edwardĮnter the temporary password, and the terminal will prompt you to set a new password for edward. Copy the encrypted password string and use that to replace edward’s old password. For example, you know the password for the user leon, so you can use it as a temporary password for edward. The encrypted password is the string of characters after the user name, between the two colons ( :).įind another user whose password you know. Look for the user whose password you want to change. Use this command to open the file using the Nano text editor: nano /etc/shadow To solve this problem, you can copy another user’s encrypted password within the /etc/shadow file. When you enter the sudo passwd edward command on the terminal, you’ll have to enter the user password for edward. However, the command may require the user’s forgotten password if the system uses the LDAP authentication.įor example, you want to change the old password of a regular user named edward. Plus, they will have to enter their passwords to proceed with the command. Remember that non-root sudo users will have to use the sudo passwd command instead. The easiest way to do that is to log in as a root or sudo user, as you can use the passwd command to change the user password easily. In some cases, you need to reset the password of a regular user who forgot their password. Passwd: password updated successfully How to Change User Password Without the Old One Once you have updated the other user password by using the passwd command, the following output will appear:.Next, the terminal will prompt the same request to enter the new password in the command line twice.Log in as the root user and use the passwd command followed by the user’s name.įor example, if you want to change the password of a user named edward, the command will look like this: passwd edward.The bash passwd command can also change the password of another user account in the system. Important! If you’re logged in as a root user and don’t specify a user account, you’ll be changing the root password.
0 Comments
Leave a Reply. |