{"id":292,"date":"2019-10-21T19:34:36","date_gmt":"2019-10-21T17:34:36","guid":{"rendered":"http:\/\/linuxboxen2.dk\/?p=292"},"modified":"2019-10-21T19:34:36","modified_gmt":"2019-10-21T17:34:36","slug":"chpasswd","status":"publish","type":"post","link":"https:\/\/www.linuxboxen.dk\/?p=292","title":{"rendered":"CHPASSWD"},"content":{"rendered":"<div class=\"view-content\">\n<div class=\"views-row\">\n<div class=\"views-field views-field-body\">\n<div class=\"field-content\">\n<p>CHPASSWD(8)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System Management Commands\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CHPASSWD(8)<\/p>\n<p>NAME<\/p>\n<p>chpasswd &#8211; update passwords in batch mode<\/p>\n<p>SYNOPSIS<\/p>\n<p>chpasswd [options]<\/p>\n<p>DESCRIPTION<\/p>\n<p>The chpasswd command reads a list of user name and password pairs<br \/>\nfrom standard input and uses this information to update a group of<br \/>\nexisting users. Each line is of the format:<\/p>\n<p>user_name:password<\/p>\n<p>By default the passwords must be supplied in clear-text, and are<br \/>\nencrypted by chpasswd. Also the password age will be updated, if<br \/>\npresent.<\/p>\n<p>The default encryption algorithm can be defined for the system with<br \/>\nthe ENCRYPT_METHOD or MD5_CRYPT_ENAB variables of \/etc\/login.defs,<br \/>\nand can be overwitten with the -e, -m, or -c options.<\/p>\n<p>chpasswd first updates all the passwords in memory, and then commits<br \/>\nall the changes to disk if no errors occured for any user.<\/p>\n<p>This command is intended to be used in a large system environment<br \/>\nwhere many accounts are created at a single time.<\/p>\n<p>OPTIONS<\/p>\n<p>The options which apply to the chpasswd command are:<\/p>\n<p>-c, &#8211;crypt-method METHOD<br \/>\nUse the specified method to encrypt the passwords.<\/p>\n<p>The available methods are DES, MD5, NONE, and SHA256 or SHA512 if<br \/>\nyour libc support these methods.<\/p>\n<p>By default (if none of the -c, -m, or -e options are specified),<br \/>\nthe encryption method is defined by the ENCRYPT_METHOD or<br \/>\nMD5_CRYPT_ENAB variables of \/etc\/login.defs.<\/p>\n<p>-e, &#8211;encrypted<br \/>\nSupplied passwords are in encrypted form.<\/p>\n<p>-h, &#8211;help<br \/>\nDisplay help message and exit.<\/p>\n<p>-m, &#8211;md5<br \/>\nUse MD5 encryption instead of DES when the supplied passwords are<br \/>\nnot encrypted.<\/p>\n<p>-R, &#8211;root CHROOT_DIR<br \/>\nApply changes in the CHROOT_DIR directory and use the<br \/>\nconfiguration files from the CHROOT_DIR directory.<\/p>\n<p>-s, &#8211;sha-rounds ROUNDS<br \/>\nUse the specified number of rounds to encrypt the passwords.<\/p>\n<p>The value 0 means that the system will choose the default number<br \/>\nof rounds for the crypt method (5000).<\/p>\n<p>A minimal value of 1000 and a maximal value of 999,999,999 will<br \/>\nbe enforced.<\/p>\n<p>You can only use this option with the SHA256 or SHA512 crypt<br \/>\nmethod.<\/p>\n<p>By default, the number of rounds is defined by the<br \/>\nSHA_CRYPT_MIN_ROUNDS and SHA_CRYPT_MAX_ROUNDS variables in<br \/>\n\/etc\/login.defs.<\/p>\n<p>CAVEATS<\/p>\n<p>Remember to set permissions or umask to prevent readability of<br \/>\nunencrypted files by other users.<\/p>\n<p>CONFIGURATION<\/p>\n<p>The following configuration variables in \/etc\/login.defs change the<br \/>\nbehavior of this tool:<\/p>\n<p>ENCRYPT_METHOD (string)<br \/>\nThis defines the system default encryption algorithm for<br \/>\nencrypting passwords (if no algorithm are specified on the<br \/>\ncommand line).<\/p>\n<p>It can take one of these values: DES (default), MD5, SHA256,<br \/>\nSHA512.<\/p>\n<p>Note: this parameter overrides the MD5_CRYPT_ENAB variable.<\/p>\n<p>MD5_CRYPT_ENAB (boolean)<br \/>\nIndicate if passwords must be encrypted using the MD5-based<br \/>\nalgorithm. If set to yes, new passwords will be encrypted using<br \/>\nthe MD5-based algorithm compatible with the one used by recent<br \/>\nreleases of FreeBSD. It supports passwords of unlimited length<br \/>\nand longer salt strings. Set to no if you need to copy encrypted<br \/>\npasswords to other systems which don&#8217;t understand the new<br \/>\nalgorithm. Default is no.<\/p>\n<p>This variable is superseded by the ENCRYPT_METHOD variable or by<br \/>\nany command line option used to configure the encryption<br \/>\nalgorithm.<\/p>\n<p>This variable is deprecated. You should use ENCRYPT_METHOD.<\/p>\n<p>SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)<br \/>\nWhen ENCRYPT_METHOD is set to SHA256 or SHA512, this defines the<br \/>\nnumber of SHA rounds used by the encryption algorithm by default<br \/>\n(when the number of rounds is not specified on the command line).<\/p>\n<p>With a lot of rounds, it is more difficult to brute forcing the<br \/>\npassword. But note also that more CPU resources will be needed to<br \/>\nauthenticate users.<\/p>\n<p>If not specified, the libc will choose the default number of<br \/>\nrounds (5000).<\/p>\n<p>The values must be inside the 1000-999,999,999 range.<\/p>\n<p>If only one of the SHA_CRYPT_MIN_ROUNDS or SHA_CRYPT_MAX_ROUNDS<br \/>\nvalues is set, then this value will be used.<\/p>\n<p>If SHA_CRYPT_MIN_ROUNDS &gt; SHA_CRYPT_MAX_ROUNDS, the highest value<br \/>\nwill be used.<\/p>\n<p>FILES<\/p>\n<p>\/etc\/passwd<br \/>\nUser account information.<\/p>\n<p>\/etc\/shadow<br \/>\nSecure user account information.<\/p>\n<p>\/etc\/login.defs<br \/>\nShadow password suite configuration.<\/p>\n<p>SEE ALSO<\/p>\n<p>passwd(1), newusers(8), login.defs(5),useradd(8).<\/p>\n<p>COLOPHON<\/p>\n<p>This page is part of the shadow-utils (utilities for managing<br \/>\naccounts and shadow password files) project.\u00a0 Information about the<br \/>\nproject can be found at \u27e8http:\/\/pkg-shadow.alioth.debian.org\/\u27e9.\u00a0 If<br \/>\nyou have a bug report for this manual page, see<br \/>\n\u27e8http:\/\/pkg-shadow.alioth.debian.org\/getinvolved.php\u27e9.\u00a0 This page was<br \/>\nobtained from the project&#8217;s upstream Subversion repository<br \/>\n(svn:\/\/anonscm.debian.org\/pkg-shadow\/) on 2014-12-30.\u00a0 If you dis\u2010<br \/>\ncover any rendering problems in this HTML version of the page, or you<br \/>\nbelieve there is a better or more up-to-date source for the page, or<br \/>\nyou have corrections or improvements to the information in this<br \/>\nCOLOPHON (which is not part of the original manual page), send a mail<br \/>\nto\u00a0man-pages@man7.org<\/p>\n<p>shadow-utils 4.1.5.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 01\/27\/2014\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CHPASSWD(8)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"view-footer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>CHPASSWD(8)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 System Management Commands\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CHPASSWD(8) NAME chpasswd &#8211; update passwords in batch mode SYNOPSIS chpasswd [options] DESCRIPTION The chpasswd command reads a list of user name and password pairs from standard input and uses this information to update a group of existing users. Each line is of the format: user_name:password By default the passwords must [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_sitemap_exclude":false,"_sitemap_priority":"","_sitemap_frequency":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-shell"],"_links":{"self":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=292"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=\/wp\/v2\/posts\/292\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxboxen.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}