Quick Answer: How to Change Password on Linux?
Contents

Steps

  • Open the Terminal if using a desktop environment. The keyboard shortcut to do this is Ctrl + Alt + T .
  • Type passwd in the terminal. Then press ↵ Enter .
  • If you have the right permissions, it will ask you for your old password. Type it in.
  • After entering your old password, enter in the new desired password.

Method 1 With the Current Root Password

  • Open a terminal window.
  • Type su at the command prompt, and press ↵ Enter .
  • Type the current root password, then press ↵ Enter .
  • Type passwd and press ↵ Enter .
  • Type a new password and press ↵ Enter .
  • Retype the new password and press ↵ Enter .
  • Type exit and press ↵ Enter .

From the official Ubuntu LostPassword documentation:

  • Reboot your computer.
  • Hold Shift during boot to start GRUB menu.
  • Highlight your image and press E to edit.
  • Find the line starting with “linux” and append rw init=/bin/bash at the end of that line.
  • Press Ctrl + X to boot.
  • Type in passwd username.
  • Set your password.

To change a password on behalf of a user, first sign on or “su” to the “root” account. Then type, “passwd user” (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.

How do I change my password on Ubuntu?

How to Change sudo Password in Ubuntu

  1. Step 1: Open the Ubuntu command line. We need to use the Ubuntu command line, the Terminal, in order to change the sudo password.
  2. Step 2: Log in as root user. Only a root user can change his/her own password.
  3. Step 3: Change the sudo password through the passwd command.
  4. Step 4: Exit the root login and then the Terminal.

How do I change a password in Unix?

The procedure for changing the password of root or any user is as follows:

  • First, log in to the UNIX server using ssh or console.
  • Open a shell prompt and type the passwd command to change root or any user’s password in UNIX.
  • The actual command to change the password for root user on UNIX is sudo passwd root.
Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest