<?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: last login date in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169494#M32062</link>
    <description>(No need to use grep with the "last" command: the syntax "last userid" should work just the same.)&lt;BR /&gt;&lt;BR /&gt;The "last" command usually reads /var/log/wtmp, not /var/log/lastlog.&lt;BR /&gt;&lt;BR /&gt;Many Linux distributions have a "logrotate" tool that is usually configured to archive the system logs, including /var/log/lastlog and /var/log/wtmp, with some cycle. The usual cycle for the lastlog and wtmp files is once a month, and the archiving is set to happen on 1st of each month.&lt;BR /&gt;&lt;BR /&gt;Go to the /var/log directory and look for files named like "wtmp.1" or "wtmp.1.gz": these are the archived versions of the files. If they have a .gz suffix, logrotate has compressed them and you may need to use gunzip to uncompress them before examining them.&lt;BR /&gt;&lt;BR /&gt;You can usually use "last -f /var/log/wtmp.1 userid" to check the information of the previous month. If you want to store the login information for a longer time, modify the logrotate settings in /etc/logrotate.conf and/or in files in the /etc/logrotate.d directory as required.&lt;BR /&gt;&lt;BR /&gt;Please read "man logrotate" for more information.&lt;BR /&gt;&lt;BR /&gt;MK</description>
    <pubDate>Fri, 28 Mar 2008 06:48:53 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2008-03-28T06:48:53Z</dc:date>
    <item>
      <title>last login date</title>
      <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169493#M32061</link>
      <description>I would like to know the last login date of all users , I use the command "last |grep userid" , that only show the information of current month , I know the file /var/log/lastlog have this information , can advise if I want to know user's last login date over 1 month , what can i do ? thx &lt;BR /&gt;</description>
      <pubDate>Fri, 28 Mar 2008 02:57:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169493#M32061</guid>
      <dc:creator>haeman</dc:creator>
      <dc:date>2008-03-28T02:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: last login date</title>
      <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169494#M32062</link>
      <description>(No need to use grep with the "last" command: the syntax "last userid" should work just the same.)&lt;BR /&gt;&lt;BR /&gt;The "last" command usually reads /var/log/wtmp, not /var/log/lastlog.&lt;BR /&gt;&lt;BR /&gt;Many Linux distributions have a "logrotate" tool that is usually configured to archive the system logs, including /var/log/lastlog and /var/log/wtmp, with some cycle. The usual cycle for the lastlog and wtmp files is once a month, and the archiving is set to happen on 1st of each month.&lt;BR /&gt;&lt;BR /&gt;Go to the /var/log directory and look for files named like "wtmp.1" or "wtmp.1.gz": these are the archived versions of the files. If they have a .gz suffix, logrotate has compressed them and you may need to use gunzip to uncompress them before examining them.&lt;BR /&gt;&lt;BR /&gt;You can usually use "last -f /var/log/wtmp.1 userid" to check the information of the previous month. If you want to store the login information for a longer time, modify the logrotate settings in /etc/logrotate.conf and/or in files in the /etc/logrotate.d directory as required.&lt;BR /&gt;&lt;BR /&gt;Please read "man logrotate" for more information.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Fri, 28 Mar 2008 06:48:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169494#M32062</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2008-03-28T06:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: last login date</title>
      <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169495#M32063</link>
      <description>if the growth of the wtmp is not high  you can avoid the log rotate on that to keep more information</description>
      <pubDate>Fri, 28 Mar 2008 11:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169495#M32063</guid>
      <dc:creator>skt_skt</dc:creator>
      <dc:date>2008-03-28T11:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: last login date</title>
      <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169496#M32064</link>
      <description>I increase the number of months of saved login history from 1 to 12 on all my RH linux servers as follows:&lt;BR /&gt;$ vi /etc/logrotate.conf&lt;BR /&gt;(find the /var/log/wtmp section)&lt;BR /&gt;rotate 12  (was rotate 1)&lt;BR /&gt;&lt;BR /&gt;-Jared</description>
      <pubDate>Fri, 28 Mar 2008 22:56:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169496#M32064</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2008-03-28T22:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: last login date</title>
      <link>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169497#M32065</link>
      <description>I also have a script to expand the standard "last" command.  Snippet:&lt;BR /&gt;&lt;BR /&gt;last "$@"&lt;BR /&gt;for cnt in $(seq 12)&lt;BR /&gt;do&lt;BR /&gt;  [ -a /var/log/wtmp.$cnt ] || break&lt;BR /&gt;  last -f /var/log/wtmp.$cnt "$@"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Jared</description>
      <pubDate>Fri, 28 Mar 2008 23:01:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/last-login-date/m-p/4169497#M32065</guid>
      <dc:creator>Jared Middleton</dc:creator>
      <dc:date>2008-03-28T23:01:27Z</dc:date>
    </item>
  </channel>
</rss>

