{"id":28668,"date":"2018-10-15T08:20:39","date_gmt":"2018-10-15T13:20:39","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=28668"},"modified":"2023-04-05T01:55:06","modified_gmt":"2023-04-05T06:55:06","slug":"linux-change-user-password","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/","title":{"rendered":"How to Change User Password in Linux"},"content":{"rendered":"
<\/div>
\"Linux
Linux Change User Password<\/figcaption><\/figure>\n

\"changeWe will show you how to change user password in Linux<\/strong>. Changing user passwords in Linux could be one of the most common tasks you will have to perform while you are administering a multi-user server. This is a very simple task though and in this tutorial, we will show you how to change the user password on a Linux VPS<\/a> regardless of which distribution you are currently using.<\/p>\n

<\/p>\n

To be able to run commands on the server you need to connect to the Linux server via SSH<\/a>. Note that only the root user, as well as system users with sudo privileges, can change a password for another user. If you log in to the server with a non-sudo user, you can only change your current user’s password.<\/p>\n

How to change your current user password in Linux<\/h2>\n

To change the password of your current user, run the following command in the terminal:<\/p>\n

passwd<\/pre>\n

You will be asked to enter your current password for verification, then you can enter the new password twice. In the example below, we are changing the password of the user1<\/code> user:<\/p>\n

[user1@vps \/]$ passwd\r\nChanging password for user user1.\r\nChanging password for user1.\r\n(current) UNIX password:\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\n

The most common errors while setting up a new password for your system user are the following:<\/p>\n

- BAD PASSWORD: The password is shorter than 8 characters\r\n- BAD PASSWORD: The password fails the dictionary check - it is too simplistic\/systematic\r\n- BAD PASSWORD: The password is the same as the old one\r\n<\/pre>\n

If you get some of the above errors while setting up the new password, it means you are using old or weak password. Generally, a password utilizing at least 14 characters including alphanumeric and grammatical symbols is sufficient. Never use passwords based upon dictionary words or significant dates.<\/p>\n

To generate a strong password<\/a> from the command line you can use one of the following commands:<\/p>\n

openssl rand -base64 14<\/pre>\n

or<\/p>\n

< \/dev\/urandom tr -dc A-Za-z0-9 | head -c14; echo<\/pre>\n

This will generate 14 characters random string which you can use as your new password. Feel free to edit the commands accordingly if you want the password to consists of more characters.<\/p>\n

How to change the password for a different user in Linux<\/h2>\n

\"ChangingAs we mentioned earlier in this blog post, you can only change the password for a different user if you are logged in as root or if your system user has sudo privileges. If you are logged in as root you should run the following command in the terminal:<\/p>\n

passwd user1<\/pre>\n

Replace user1<\/code> with the name of the user that you want to change its password. When you are changing the password for a different user as root, you don’t have to specify the old password, and the output after successful password change should look like the one below:<\/p>\n

[root@vps \/]# passwd user1\r\nChanging password for user user1.\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\n

If the user that you are currently logged in as has sudo privileges and you want to change the password for a different user, you must use sudo<\/code> in your command:<\/p>\n

sudo passwd user1<\/pre>\n

In our example below, we are logged in as sudouser<\/code>, and we are changing the password for user user1<\/code>:<\/p>\n

[sudouser@vps \/]$ sudo passwd user1\r\n\r\nWe trust you have received the usual lecture from the local System\r\nAdministrator. It usually boils down to these three things:\r\n\r\n    #1) Respect the privacy of others.\r\n    #2) Think before you type.\r\n    #3) With great power comes great responsibility.\r\n\r\n[sudo] password for sudouser:\r\nChanging password for user user1.\r\nNew password:\r\nRetype new password:\r\npasswd: all authentication tokens updated successfully.\r\n<\/pre>\n

First, you will be prompted to enter the password of your current user to verify that you have sudo privileges and once the verification is successful you will be asked to enter the new password for the other user.<\/p>\n

Again, make sure that you are using a strong password for all your users because using a weak password for some of your system users will put the other users at huge risk.<\/p>\n


\n

\"howOf course, you don\u2019t have change user password in Linux<\/strong>, if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to change the user password in Linux for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n

PS<\/strong><\/span>. If you liked this post on changing user password in Linux<\/strong>, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"

We will show you how to change user password in Linux. Changing user passwords in Linux could be one of … <\/p>\n

Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":28723,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2071,13],"tags":[1759,27,1760],"yoast_head":"\nHow to Change User Password in Linux - RoseHosting<\/title>\n<meta name=\"description\" content=\"How to Change User Password in Linux - RoseHosting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change User Password in Linux - RoseHosting\" \/>\n<meta property=\"og:description\" content=\"How to Change User Password in Linux - RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-15T13:20:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-05T06:55:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Change User Password in Linux\",\"datePublished\":\"2018-10-15T13:20:39+00:00\",\"dateModified\":\"2023-04-05T06:55:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\"},\"wordCount\":627,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg\",\"keywords\":[\"change password\",\"Linux\",\"user password\"],\"articleSection\":[\"Linux\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\",\"name\":\"How to Change User Password in Linux - RoseHosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg\",\"datePublished\":\"2018-10-15T13:20:39+00:00\",\"dateModified\":\"2023-04-05T06:55:06+00:00\",\"description\":\"How to Change User Password in Linux - RoseHosting\",\"breadcrumb\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg\",\"width\":742,\"height\":372,\"caption\":\"Linux Change User Password\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.rosehosting.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change User Password in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#website\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"name\":\"RoseHosting\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/RoseHosting\",\"https:\/\/x.com\/rosehosting\",\"https:\/\/www.linkedin.com\/in\/rosehosting\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/09271207587f897ab46faaed9b355252?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/09271207587f897ab46faaed9b355252?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\/\/www.rosehosting.com\",\"https:\/\/www.facebook.com\/rosehosting.helpdesk\"],\"url\":\"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change User Password in Linux - RoseHosting","description":"How to Change User Password in Linux - RoseHosting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/","og_locale":"en_US","og_type":"article","og_title":"How to Change User Password in Linux - RoseHosting","og_description":"How to Change User Password in Linux - RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2018-10-15T13:20:39+00:00","article_modified_time":"2023-04-05T06:55:06+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg","type":"image\/jpeg"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Change User Password in Linux","datePublished":"2018-10-15T13:20:39+00:00","dateModified":"2023-04-05T06:55:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/"},"wordCount":627,"commentCount":2,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg","keywords":["change password","Linux","user password"],"articleSection":["Linux","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/","url":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/","name":"How to Change User Password in Linux - RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg","datePublished":"2018-10-15T13:20:39+00:00","dateModified":"2023-04-05T06:55:06+00:00","description":"How to Change User Password in Linux - RoseHosting","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2018\/10\/Linux-Change-User-Password.jpg","width":742,"height":372,"caption":"Linux Change User Password"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/linux-change-user-password\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Change User Password in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"]},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/09271207587f897ab46faaed9b355252?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09271207587f897ab46faaed9b355252?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28668"}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=28668"}],"version-history":[{"count":2,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28668\/revisions"}],"predecessor-version":[{"id":44383,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/28668\/revisions\/44383"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/28723"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=28668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=28668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=28668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}