{"id":74,"date":"2007-09-04T17:29:15","date_gmt":"2007-09-04T15:29:15","guid":{"rendered":"http:\/\/www.shukko.com\/x3\/2007\/09\/04\/batch-change-all-user-passwords-linux-console\/"},"modified":"2007-09-15T03:19:23","modified_gmt":"2007-09-15T01:19:23","slug":"batch-change-all-user-passwords-linux-console","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2007\/09\/04\/batch-change-all-user-passwords-linux-console\/","title":{"rendered":"batch change all user passwords linux console"},"content":{"rendered":"<p>batch change all user passwords linux console<\/p>\n<p>Tum kullanicilarin parolalarini toplu halde degistirmek icin hos bir script.<\/p>\n<p>Isim acele oldugundan scripti duzenlemeye vakit ayiramadim oldugu gibi kullandim.<\/p>\n<p>mesela uid i 1000 ve yuksek olanlari listelemesi gereken awk satiri calismiyor adam gibi.<\/p>\n<p>vaktim olunca bakarim bir ara \ud83d\ude42<\/p>\n<p>orjinal scriptin random password generatoru baska birseyler istediginden onu degistirdim vs vs..<\/p>\n<p><code><br \/>\n#!\/bin\/bash<br \/>\n# Script to update user password in batch mode<br \/>\n# You must be a root user to use this script<br \/>\n# -------------------------------------------------------------------------<br \/>\n# Copyright (c) 2005 nixCraft project <http:><br \/>\n# This script is licensed under GNU GPL version 2.0 or above<br \/>\n# -------------------------------------------------------------------------<br \/>\n# This script is part of nixCraft shell script collection (NSSC)<br \/>\n# Visit http:\/\/bash.cyberciti.biz\/ for more information.<br \/>\n# ----------------------------------------------------------------------<br \/>\n# \/root is good place to store clear text password<br \/>\nFILE=\"\/root\/batch.passwd\"<\/http:><\/code><\/p>\n<p># get all non-root user account<br \/>\n# By default on most linux non-root uid starts<br \/>\n# from 1000<\/p>\n<p>USERS=$(awk -F: &#8216;{ if ( $1 &gt;1000 ) print $1}&#8217; \/etc\/passwd)<\/p>\n<p># create file with random password<br \/>\necho &#8220;Generating file, please wait&#8230;&#8221;<\/p>\n<p># overwrite file<br \/>\n&gt;$FILE<\/p>\n<p>for u in $USERS<br \/>\ndo<br \/>\np=$(dd if=\/dev\/urandom count=200 bs=1 2&gt;\/dev\/null|tr &#8220;\\n&#8221; &#8221; &#8220;|sed &#8216;s\/[^a-zA-Z0-9]\/\/g&#8217;|cut -c-8) # create random password<br \/>\necho &#8220;$u:$p&#8221; &gt;&gt; $FILE # save USERNAME:PASSWORD pair<br \/>\ndone<br \/>\necho &#8220;&#8221;<br \/>\necho &#8220;Random password and username list stored in $FILE file&#8221;<br \/>\necho &#8220;Review $FILE file, once satisfied execute command: &#8221;<br \/>\necho &#8220;chpasswd &lt; $FILE&#8221;<\/p>\n<p># Uncomment following line if you want immediately update all users password,<br \/>\n# be careful with this option, it is recommended that you review $FILE first<br \/>\n# chpasswd &lt; $FILE<br \/>\nsonra<\/p>\n<p>batch.passwd dosyasini uid 1000 den asagi kullanicilari temizlemek icin editle.<br \/>\nsonra ver gazi.<br \/>\n<code><br \/>\nchpasswd &lt; batch.passwd<br \/>\n<\/code><\/p>\n<p>oldu bitti.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>batch change all user passwords linux console Tum kullanicilarin parolalarini toplu halde degistirmek icin hos bir script. Isim acele oldugundan scripti duzenlemeye vakit ayiramadim oldugu gibi kullandim. mesela uid i 1000 ve yuksek olanlari listelemesi gereken awk satiri calismiyor adam gibi. vaktim olunca bakarim bir ara \ud83d\ude42 orjinal scriptin random password generatoru baska birseyler istediginden [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":0,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}