<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: gawk command in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602084#M19124</link>
    <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;perl -ni -e '@a=split /:/;$a[1]="*";$,=":";print @a;' /etc/shadow&lt;BR /&gt;&lt;BR /&gt;Note: It will automatically change /etc/shadow file also. So try to backup /etc/shadow file as /etc/shadow.org&lt;BR /&gt;&lt;BR /&gt;hth.</description>
    <pubDate>Fri, 12 Aug 2005 00:58:06 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-08-12T00:58:06Z</dc:date>
    <item>
      <title>gawk command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602082#M19122</link>
      <description>Hi all, can you please help me with a one liner in gawk that says chnage the /etc/shadow password field from a password to just a *.&lt;BR /&gt;&lt;BR /&gt;thanks and points will be assigned. &lt;BR /&gt;&lt;BR /&gt;Currently /etc/shadow looks like this...&lt;BR /&gt;&lt;BR /&gt;odaos:$1$0rP21yM.$.NsFDQTtnnu7GE5qs84D/0:12492:0:99999:7:::&lt;BR /&gt;&lt;BR /&gt;I want the 2nd field to be like such "*".</description>
      <pubDate>Thu, 11 Aug 2005 14:51:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602082#M19122</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2005-08-11T14:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: gawk command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602083#M19123</link>
      <description>You actually want to modify the '/etc/shadow' file?  or just a display of it with the password masked ?&lt;BR /&gt;&lt;BR /&gt;If the first, then don't use awk, as it will require a temporary file and a move.&lt;BR /&gt;&lt;BR /&gt;If you want to lock an account, then use the 'passwd -l &lt;USER&gt;' command.  This prefix's the encrypted password with an '!' which makes it invalid.&lt;BR /&gt;&lt;BR /&gt;If it's just for displaying on the screen, then use something like:&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN {FS=":";OFS=FS}{$2 = "*";print}' /etc/shadow&lt;BR /&gt;&lt;BR /&gt;FS = field separator, OFS = output field separator.&lt;/USER&gt;</description>
      <pubDate>Thu, 11 Aug 2005 15:58:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602083#M19123</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-08-11T15:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: gawk command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602084#M19124</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;perl -ni -e '@a=split /:/;$a[1]="*";$,=":";print @a;' /etc/shadow&lt;BR /&gt;&lt;BR /&gt;Note: It will automatically change /etc/shadow file also. So try to backup /etc/shadow file as /etc/shadow.org&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Fri, 12 Aug 2005 00:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602084#M19124</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-08-12T00:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: gawk command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602085#M19125</link>
      <description>thanks but I still didn't get the answer I am looking for. Currently my /etc/shdow file has the password entry. I want to chnage this field to just a "*". This way users will be forced to authenticate to windows. I don't want a password in the 2nd field, I want a star * in that field.</description>
      <pubDate>Fri, 12 Aug 2005 09:37:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602085#M19125</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2005-08-12T09:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: gawk command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602086#M19126</link>
      <description>Why don't you just use the usermod -L command to lock the users accounts?&lt;BR /&gt;&lt;BR /&gt;Anyway, try this:&lt;BR /&gt;&lt;BR /&gt;awk -F ":" -v OFS=":" '$2="*" { print $0 }' /etc/shadow</description>
      <pubDate>Fri, 12 Aug 2005 10:01:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/gawk-command/m-p/3602086#M19126</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-08-12T10:01:47Z</dc:date>
    </item>
  </channel>
</rss>

