{"id":54326,"date":"2022-10-19T23:22:25","date_gmt":"2022-10-20T06:22:25","guid":{"rendered":"https:\/\/linuxhint.com\/?p=54326"},"modified":"2022-10-24T19:24:08","modified_gmt":"2022-10-25T02:24:08","slug":"change_users_password_linux","status":"publish","type":"post","link":"https:\/\/linuxhint.com\/change_users_password_linux\/","title":{"rendered":"How to Change a User\u2019s Password in Linux"},"content":{"rendered":"<div id=\"wpbody\">We use the passwd command in Linux to change a user password with ease. This command replaces an old authentication token\/password for a user with a new one and it is stored in Linux system\u2019s \/etc\/shadow file.<\/p>\n<p>Today, we will explore the two methods to change the password in a Linux system. One method follows the change of password via Graphical User Interface (GUI) and the other method involves using the Linux commands that are executed on Linux command line OR Terminal to change the password.<\/p>\n<h2>Method 1: Change the Password via GUI<\/h2>\n<p>Let\u2019s begin by first exploring how to change a user\u2019s password in Linux via GUI. On the top right of the screen, locate the icons of the battery and other settings. Click on it. A window will open as shown in the following:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-1.png\" alt=\"\" width=\"535\" height=\"580\" class=\"aligncenter size-full wp-image-239794\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-1.png 535w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-1-277x300.png 277w\" sizes=\"(max-width: 535px) 100vw, 535px\" \/><\/p>\n<p>Next, click on the Settings and go to the Users option that is available on the left panel.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-2.png\" alt=\"\" width=\"652\" height=\"538\" class=\"aligncenter size-full wp-image-239795\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-2.png 652w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-2-300x248.png 300w\" sizes=\"(max-width: 652px) 100vw, 652px\" \/><\/p>\n<p>As you can see, the password option is available at the center of the screen. Click this option to change the user\u2019s password. Now, enter the current password and then a new password. Choose a password that is strong to keep your system secure against brute force attack.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-3.png\" alt=\"\" width=\"736\" height=\"435\" class=\"aligncenter size-full wp-image-239797\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-3.png 736w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-3-300x177.png 300w\" sizes=\"(max-width: 736px) 100vw, 736px\" \/><\/p>\n<p>This is how we change a password via GUI. So simple!<\/p>\n<h2>Method 2: Change the Password via Linux Command Line<\/h2>\n<p>Some users are more comfortable with the command line rather than the GUI. This section is for those people! <\/p>\n<p>Let\u2019s see how a password is changed via Linux command line or Terminal.<\/p>\n<h2>Change Your Own Password<\/h2>\n<p>First, we will see how a user can change his own password. For that, the passwd command is used followed by the username as shown in the following:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">passwd<\/span> <span class=\"sy0\">&lt;<\/span>username<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Example:<\/p>\n<p>Here, the user is azifa and we are changing azifa\u2019s password. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-4.png\" alt=\"\" width=\"240\" height=\"46\" class=\"aligncenter size-full wp-image-239798\" \/><\/p>\n<p>First, the user is prompted to provide the current password. Once it is accepted, the user gives the new password. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-5.png\" alt=\"\" width=\"705\" height=\"224\" class=\"aligncenter size-full wp-image-239799\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-5.png 705w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-5-300x95.png 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/p>\n<h2>Change the Password for Another User<\/h2>\n<p>What if another user\u2019s password must be changed, how is that going to happen? Well, it\u2019s also as simple as changing your own password. The only difference is that the system administrator can only change another user\u2019s password.<\/p>\n<p>In this case, we use the previous command but with sudo:<\/p>\n<p>Sudo allows an access as a super user after accepting the password for sudo. After that, you will be prompted to change the password for the mentioned user.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> <span class=\"sy0\">&lt;<\/span>username<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Example:<img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/6-48.png\" alt=\"\" width=\"336\" height=\"54\" class=\"aligncenter size-full wp-image-239800\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/6-48.png 336w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/6-48-300x48.png 300w\" sizes=\"(max-width: 336px) 100vw, 336px\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-6.png\" alt=\"\" width=\"737\" height=\"117\" class=\"aligncenter size-full wp-image-239801\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-6.png 737w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-6-300x48.png 300w\" sizes=\"(max-width: 737px) 100vw, 737px\" \/><\/p>\n<h2>Change the Sudo Password <\/h2>\n<p>To change the sudo password, you need as a super user. To do that, execute this command and then provide a sudo password:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"re5\">-i<\/span><\/div><\/div>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-7.png\" alt=\"\" width=\"114\" height=\"29\" class=\"aligncenter size-full wp-image-239802\" \/><\/p>\n<p>Once you get the root access after providing the sudo password, execute the passwd command followed by the username to change the password:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">passwd<\/span> <span class=\"sy0\">&lt;<\/span>username<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Example:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-8.png\" alt=\"\" width=\"237\" height=\"52\" class=\"aligncenter size-full wp-image-239803\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-9.png\" alt=\"\" width=\"693\" height=\"117\" class=\"aligncenter size-full wp-image-239804\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-9.png 693w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-9-300x51.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/p>\n<p>You can also directly use the passwd command with sudo. First, you will be prompted to enter the sudo password. Once accepted, you can change the root password as we did before.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> root<\/div><\/div>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-10.png\" alt=\"\" width=\"332\" height=\"45\" class=\"aligncenter size-full wp-image-239805\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-10.png 332w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-10-300x41.png 300w\" sizes=\"(max-width: 332px) 100vw, 332px\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-12.png\" alt=\"\" width=\"739\" height=\"119\" class=\"aligncenter size-full wp-image-239806\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-12.png 739w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/02\/How-to-Change-a-User-12-300x48.png 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/p>\n<p>This is how we use the Linux command line to change the password. <\/p>\n<h2>Conclusion<\/h2>\n<p>Today, we explored the different ways where we can change the password in a Linux system. Some users are more comfortable with the Linux command line. However, some like to interact with GUI more than the Linux terminal. We provided a detailed guide to change the password for both types of Linux users. The guide is supported by different examples that will help you learn.<\/p>\n<p>We hope you liked the tutorial.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Practical tutorial on how to change a user\u2019s password in Linux using two methods &#8211; via Graphical User Interface (GUI) and via Linux command line OR Terminal.<\/p>\n","protected":false},"author":72,"featured_media":239807,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2161],"tags":[],"class_list":["post-54326","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands"],"_links":{"self":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/54326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/users\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/comments?post=54326"}],"version-history":[{"count":0,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/54326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media\/239807"}],"wp:attachment":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media?parent=54326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/categories?post=54326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/tags?post=54326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}