<?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: help me write a script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262871#M33716</link>
    <description>you could also touch /var/log/btmp and then use lastb. Then use:&lt;BR /&gt;&lt;BR /&gt;lastb root | grep "$(date '+%a %b %Oe')"&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 04 Sep 2008 13:58:09 GMT</pubDate>
    <dc:creator>Court Campbell</dc:creator>
    <dc:date>2008-09-04T13:58:09Z</dc:date>
    <item>
      <title>help me write a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262869#M33714</link>
      <description># tail -20 /var/log/messages |grep "Authentication failure for root"&lt;BR /&gt;Sep  4 12:26:05 gateway sshd[5882]: error: PAM: Authentication failure for root from 192.168.0.6&lt;BR /&gt;&lt;BR /&gt;I have to write a script that creates a loginfailure_"$(date +%m-%d-%y)" file daily(daily via cron). the script only redirects the root login failures to this file(loginfailure_"$(date +%m-%d-%y)") on the daily basis&lt;BR /&gt;&lt;BR /&gt;i.e "loginfailure_09-04-08" only contains the login failures of root account of "Sep  4" only.&lt;BR /&gt;&lt;BR /&gt;and "loginfailure_09-05-08" only contains the login failures of root account of "Sep  5" only.&lt;BR /&gt;&lt;BR /&gt;please help.&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 04 Sep 2008 06:49:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262869#M33714</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2008-09-04T06:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: help me write a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262870#M33715</link>
      <description>Hi Maaz:&lt;BR /&gt;&lt;BR /&gt;This could be as simple as:&lt;BR /&gt;&lt;BR /&gt;# grep "$(date '+%b %e')" /var/log/messages | grep "Authentication failure for root" &amp;gt; loginfailure_$(date +%m-%d-%y)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Sep 2008 12:46:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262870#M33715</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-04T12:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: help me write a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262871#M33716</link>
      <description>you could also touch /var/log/btmp and then use lastb. Then use:&lt;BR /&gt;&lt;BR /&gt;lastb root | grep "$(date '+%a %b %Oe')"&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Sep 2008 13:58:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262871#M33716</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2008-09-04T13:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: help me write a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262872#M33717</link>
      <description>James R. Ferguson nice help ;) Thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Dear Court Campbell, thanks for support but following doesnt works&lt;BR /&gt;&lt;BR /&gt;# touch /var/log/btmp&lt;BR /&gt;# lastb root | grep "$(date '+%a %b %Oe')"&lt;BR /&gt;btmp begins Fri Sep  5 09:45:59 2008&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks once again.&lt;BR /&gt;Regards&lt;BR /&gt;Maaz</description>
      <pubDate>Fri, 05 Sep 2008 03:50:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262872#M33717</guid>
      <dc:creator>Maaz</dc:creator>
      <dc:date>2008-09-05T03:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: help me write a script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262873#M33718</link>
      <description>Well, you have to have some failed root logins first. You can create the file and expect to have a failed login that quickly. And I am not saying that means it's impossible. I bet if you run it again later you will see something. Also, getting nothing means root didn't have any failed logins.</description>
      <pubDate>Fri, 05 Sep 2008 15:33:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-me-write-a-script/m-p/4262873#M33718</guid>
      <dc:creator>Court Campbell</dc:creator>
      <dc:date>2008-09-05T15:33:32Z</dc:date>
    </item>
  </channel>
</rss>

