{"id":8572,"date":"2021-07-20T12:53:33","date_gmt":"2021-07-20T12:53:33","guid":{"rendered":"https:\/\/linuxways.net\/?p=8572"},"modified":"2021-07-20T12:53:33","modified_gmt":"2021-07-20T12:53:33","slug":"chpasswd-command-in-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/chpasswd-command-in-linux\/","title":{"rendered":"Chpasswd Command in Linux"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Creating user and managing user password is one of the basic tasks of the Linux system administrator. That&#8217;s why the chpasswd command was born.<\/p>\n<p>chpasswd command is used to change the password equivalent to passwd command. But chpasswd command allows changing passwords of multiple users easily.<\/p>\n<p>This article will show you how to use the chpasswd command in Linux as we go through below.<\/p>\n<h2>The syntax of chpasswd command<\/h2>\n<pre>$ sudo chpasswd<\/pre>\n<p>user1:password<\/p>\n<p>user2:password<\/p>\n<p>user3:password<\/p>\n<p>Press Enter to go to the next user. Once done, press Ctrl+d to exit and the new password will be saved.<\/p>\n<p>For example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1288\" height=\"146\" class=\"wp-image-8573\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-591.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-591.png 1288w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-591-300x34.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-591-1024x116.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-591-768x87.png 768w\" sizes=\"auto, (max-width: 1288px) 100vw, 1288px\" \/><\/p>\n<p>Or you can create a password file with the cat command:<\/p>\n<pre>$ cat &gt; file.txt<\/pre>\n<p>For example:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1212\" height=\"148\" class=\"wp-image-8574\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-592.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-592.png 1212w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-592-300x37.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-592-1024x125.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-592-768x94.png 768w\" sizes=\"auto, (max-width: 1212px) 100vw, 1212px\" \/><\/p>\n<p>Press Ctrl+ D to exit.<\/p>\n<p>Then send this file to chpasswd command:<\/p>\n<pre>$ sudo chpasswd &lt; pass.txt<\/pre>\n<h2>Options<\/h2>\n<ol>\n<li><strong>-e<\/strong> Use encrypted password<\/li>\n<\/ol>\n<p>This tells chpasswd that your password is encrypted so chpasswd won&#8217;t re-encrypt it.<\/p>\n<ol>\n<li><strong>-m , -md5 <\/strong>Use MD5 hash encryption<\/li>\n<li><strong>-c<\/strong> Choose 1 encryption method<\/li>\n<\/ol>\n<p>For example, I want to choose DES as the encryption method for my password:<\/p>\n<pre>$ sudo chpasswd -c DES<\/pre>\n<ol>\n<li><strong>-h, -help <\/strong>Ask for help information from the command<\/li>\n<\/ol>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1546\" height=\"452\" class=\"wp-image-8575\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593.png 1546w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593-300x88.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593-1024x299.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593-768x225.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-593-1536x449.png 1536w\" sizes=\"auto, (max-width: 1546px) 100vw, 1546px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>You\u2019ve already gone through the details of how to use the chpasswd command in Linux.<\/p>\n<p>Thanks for reading.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Creating user and managing user password is one of the basic tasks of the Linux system administrator. That&#8217;s why the chpasswd command was born. chpasswd command is&hellip;<\/p>","protected":false},"author":1,"featured_media":8630,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4,5,83,165,2],"tags":[438],"class_list":["post-8572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-debian","category-mint","category-opensuse","category-red-hat","category-ubuntu","tag-chpasswd-command"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=8572"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8572\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/8630"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=8572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=8572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=8572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}