How to Change Linux Password

Passwords that are rarely changed can be an opening for hackers to penetrate the security of your Linux operating system. There are many reasons why people rarely or never change their passwords, whether it's because they forget or ignore them.

The following is a complete guide on 7 ways to change Linux passwords along with commands so that you can use it to update your old password with a new password to make it more secure.

Changing the Root Password in Linux

Linux is a type of open source operating system that is widely used around the world.

One of the most important things that you should not miss when utilizing this operating system is to change the password regularly.

  • You must first open a terminal and then log in as root using the special command su
  • Next type in passwd then press enter
  • Enter the old root password first and don't forget to press enter
  • Type in the new root password and then press enter
  • Type the new root password again, then press enter

How to Change User Password

Here is how to change the user password on the Linux operating system that you can follow.c

  • First open the terminal then log in as a user using the su nameuser command.
  • After that type the passwd command then press enter
  • Enter the old user password then press enter
  • Replace the old password with the new user password then press enter
  • Re-enter the new password and press enter

Change the password using the terminal

One way to replace an old password with a new one is by utilizing the chapaswd utility. Below are the steps you can follow to change the password by utilizing the terminal.

  • As usual, open the terminal and log in as user or root.
  • Then type the command: echo 'nameuser:new password' | sudo chpasswd or you can also use this command to change the password: echo 'root: new password' | sudo chpasswd

Changing Linux Password Using GUI

Besides using the terminal, you can change the password on the Linux operating system by utilizing the GUI or graphical user interface.

Usually, this GUI is provided by desktop environments such as KDE or GNOME. The following are the steps to change the password by utilizing GNOME and KDE.

How to change password with GNOME

  • First press the Activities button in the upper left corner of the screen.
  • After that click Settings and then click on the icon that appears
  • Select and click User on the left panel.
  • Determine and select the user whose password you want to change then click on the Account Disabled button located at the bottom of the profile photo.
  • Enter the old password to be changed
  • Then change the new password twice
  • Click Change so that the password changes to a new one

How to Change Password with KDE

  • First click on the K menu section located at the bottom of the screen on the left side
  • Click and select System Setting
  • Click and select Account Details
  • Select and click the name of the user whose password you want to change.
  • Select and click the Change Password button
  • Enter the old password to be changed
  • Type the new password twice
  • Press the Ok button to save the changes and the old password has been replaced with the new one.

Cara Reset Password di Sistem Operasi Linux

Almost everyone has forgotten the password they have created. The password for the Linux operating system is no exception.

How to change a Linux password for a forgotten old password is slightly different because there are several steps that must be taken.

But of course, you don't have to worry too much because the steps are quite easy. Here are the seven steps that need to be done to reset Linux password through its operating system.

  • The first step you need to do is reboot your computer by pressing the Esc or Shift key when the boot screen appears.
  • After that, click and select Advance Option or Recovery Mode on the boot menu.
  • Click and select Root Drop to Sell Prompt and then press enterc
  • Next write the mount-rw-o remount/ command and then press enter
  • Type the command passwt root then press enter
  • Write down the new root password and confirm the new password.
  • Write the reeboot command so that the computer restarts

How to Change User Password on Linux Operating System

Next, we will discuss how to reset user passwords on the Linux operating system.

  • First Reboot the computer and then select Advanced Option or Recovery Mode in the boot menu.
  • Click and select Drop to Shell Prompt then press enter
  • Write the mount-rw-o remount/ command and then press enter
  • Write the passwd username command then replace the username with the Linux user name that you want to reset the password, after that press enter
  • Type a new password for the user and confirm the password.
  • Write the reboot command to restart the computer

Reset Password with USB or Live CD

To reset a password using USB or Live CD you need to prepare a few things and perform a few steps.

  • First you need to download the iso image of a Linux Live CD such as Fedora or Ubuntu
  • The next step is to burn the USB or CD ISO image using a special USB or CD burning application.
  • Next, you must boot your computer using a USB or CD and select the Live Session or Try Linux option.
  • Open the terminal then type the sudo su command so you can enter root mode
  • Write the fdisk-I command to find out where the Linux partition is located.
  • Write the mount/dev/sdXY/mnt command to mount the Linux partition (replace the sdXY part with the Linux location)
  • Write the chroot/mnt command to change to the root directory
  • Write the passwt username command then press enter (replace the username section using the name of the user whose password will be reset).
  • Type in a new password for the user and confirm the password.
  • Write the exit and reboot commands to restart the computer.

Securing passwords in the Linux operating system is very important to protect data and information from irresponsible parties.

Changing Linux Passwords is Important for Improving Security

So, it can be concluded that security in Linux operating systems is very important and must be maintained properly. Changing passwords regularly is crucial to prevent potential attacks from hackers trying to hack into the system.

This guide provides various ways to change passwords for both root and user accounts.

From the use of terminals to graphical interfaces (GUIs) such as GNOME and KDE, various options are provided so that users can change passwords according to their own preferences and convenience.

In addition, the guide also includes steps for resetting passwords in case of forgotten passwords, as well as using a USB or Live CD as an alternative solution.

All the steps are explained in detail, allowing users to better secure their passwords.
Overall, understanding how to change Linux passwords and commands is an important step in maintaining security and protecting data from external threats.

By implementing these guidelines, users can improve the security of their Linux operating system and better maintain information security.

Selamat mencoba!

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.