How to Reset Your Username & Password on Linux

Linux is a computer operating system based on Unix. On Linux, every user has to log in using his user name and password; without those tokens of authentication (or authority delegated from another legitimate user), a user cannot run a single application on Linux. If you have an existing account on a Linux system, you can change the user name and the password to log in -- without having to change file ownership or move any file to another directory by hand.

Things You'll Need

  • Root access to the Linux computer
Show More

Instructions

    • 1

      Log in to the computer as user "root" by entering "root" as a response to the "login:" prompt, and then entering the root password as a response to the "password:" prompt. Launch a command shell by either logging in in text mode or launching a terminal window from the graphical user interface.

    • 2

      Change the user name of the account by typing the following command into a shell:

      usermod -m -d /home/newuser newuser olduser

      Replace "newuser" with the new user name for the account, and "olduser" with the old user name. Press "Enter." The "usermod" command will change the name in the account while keeping the same numerical userid, create the new home directory "/home/newuser," move to it all the contents of the old home directory and delete the old home directory.

    • 3

      Reset the password for the account by typing the following command into a shell:

      passwd newuser

      Press "Enter." Linux will prompt you to enter and re-enter the new password for the account, pressing "Enter" after the password both times. After that, the "newuser" account will be ready to use with the same files and permissions previously present for "olduser."

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured