Tips & Tricks, Tutorials, Hacking, Troubleshooting,

For security reasons, it is sometimes smart to change login passwords periodically. This post shows you how to change the root password in Ubuntu if you want to do so periodically, or if you think the security or your computer has been compromised.

NOTE: Ubuntu is initially setup such that the first user created is automatically given Administrator, or root, privileges and has the right to become root using sudo. Subsequent users who need root privileges need to be manually given Administrator privileges.

Change the Root Password on the User Settings Dialog Box

To use a graphical user interface (GUI) to change the root password, press Alt + F2 to open the Run Application dialog box. Enter the following line in the edit box and click Run.

gksu users-admin

Opening the Users Settings dialog box

Changing users settings requires you to enter your user password. Enter your password when prompted.

Entering your password

The Users Settings dialog box displays. If you need to give a user Administrator privileges, select the user in the list on the left and click the Change button to the right of the Account type field.

Changing the account type

Select the Administrator radio button and click OK.

Selecting Administrator as the user account type

Now, to change the root password, select the root user from the list on the left and click the Change button to the right of the Password field.

Clicking the Change button for changing the root password

The Change User Password dialog box displays. Enter the current root password in the Current password edit box. Enter the new root password in the New password edit box and again in the Confirmation edit box. Click OK.

Changing the user password for the root user

Click Close to close the Users Settings dialog box.

Closing the Users Settings dialog box

Change the Root Password Using the Command Line

A simpler and quicker method of changing the root password involves using the command line. To use this method, select Accessories | Terminal from the Applications menu.

Opening the Terminal window

Type the following line at the prompt and press Enter.

$ sudo passwd root

Enter your user password when prompted. Enter the new root password at the Enter new UNIX password prompt and again at the Retype new UNIX password prompt. You should see a message that the password has been updated successfully. To close the Terminal window, type “exit” (without the quotes) at the prompt and press Enter.

Changing the root password in the Terminal window

Be sure to select a strong password to ensure the security of your computer.

No comments:

Post a Comment