<?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: search inactive users in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291161#M182191</link>
    <description>Hi,&lt;BR /&gt;I'm sorry for not being clear enough describing my problems. I want to know who has (and hasn't) logged in to the machine for the last 3 month. This machine alive from 2001 with /var/adm/wtmp around 34906800 bytes.&lt;BR /&gt;&lt;BR /&gt;My temporary solution is:&lt;BR /&gt;&lt;BR /&gt;$ cat /var/adm/wtmp | /usr/sbin/acct/fwtmp&lt;BR /&gt;&lt;BR /&gt;and parse the result with some perl script.&lt;BR /&gt;&lt;BR /&gt;I'm looking for nicer solutions :D.&lt;BR /&gt;&lt;BR /&gt;rgrds,&lt;BR /&gt;EF</description>
    <pubDate>Mon, 31 May 2004 07:52:59 GMT</pubDate>
    <dc:creator>Emir Faisal</dc:creator>
    <dc:date>2004-05-31T07:52:59Z</dc:date>
    <item>
      <title>search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291155#M182185</link>
      <description>Hi,&lt;BR /&gt;how search "who has logged in for the last 3 month" ? I've tried 'last', but it doesn't have any 'year' information.</description>
      <pubDate>Mon, 31 May 2004 06:34:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291155#M182185</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-05-31T06:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291156#M182186</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You can use the who(1) command to find the time the user logged into the system. It gives the date and time the use logged into the system,&lt;BR /&gt;&lt;BR /&gt;man who will help.&lt;BR /&gt;&lt;BR /&gt;manish.</description>
      <pubDate>Mon, 31 May 2004 06:45:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291156#M182186</guid>
      <dc:creator>Manish Srivastava</dc:creator>
      <dc:date>2004-05-31T06:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291157#M182187</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The "last" command output depend of the info logged into /var/adm/wtmp file. May be this file is too big or corrupted. To fix:&lt;BR /&gt;# cp /dev/null /var/adm/wtmp&lt;BR /&gt;&lt;BR /&gt;Other way to check last logig date will be checking the timestamp of .sh_history into $HOME directory of each user. Off course, for this, users must be active history log.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Mon, 31 May 2004 07:01:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291157#M182187</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-05-31T07:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291158#M182188</link>
      <description>I've read the man page, but I can't make it display any year information. It only print 31 May without year.&lt;BR /&gt;Maybe I miss something from the man page ? I use "who -a".</description>
      <pubDate>Mon, 31 May 2004 07:21:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291158#M182188</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-05-31T07:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291159#M182189</link>
      <description>is "cp /dev/null /var/adm/wtmp" will zero my login record ? This is not what i want.&lt;BR /&gt;&lt;BR /&gt;command line history mostly turned off on our system.</description>
      <pubDate>Mon, 31 May 2004 07:29:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291159#M182189</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-05-31T07:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291160#M182190</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;If the year is not indicated, asummes that is the current year. &lt;BR /&gt;&lt;BR /&gt;Previously you had not been especific for your issue, for that reason I thought that the problem was of corruption of the file and I suggested you to copy /dev/null. So pls do not copy null in your case.&lt;BR /&gt;&lt;BR /&gt;Try to be full explicit in your issue description.&lt;BR /&gt;&lt;BR /&gt;Rgds.</description>
      <pubDate>Mon, 31 May 2004 07:41:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291160#M182190</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-05-31T07:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291161#M182191</link>
      <description>Hi,&lt;BR /&gt;I'm sorry for not being clear enough describing my problems. I want to know who has (and hasn't) logged in to the machine for the last 3 month. This machine alive from 2001 with /var/adm/wtmp around 34906800 bytes.&lt;BR /&gt;&lt;BR /&gt;My temporary solution is:&lt;BR /&gt;&lt;BR /&gt;$ cat /var/adm/wtmp | /usr/sbin/acct/fwtmp&lt;BR /&gt;&lt;BR /&gt;and parse the result with some perl script.&lt;BR /&gt;&lt;BR /&gt;I'm looking for nicer solutions :D.&lt;BR /&gt;&lt;BR /&gt;rgrds,&lt;BR /&gt;EF</description>
      <pubDate>Mon, 31 May 2004 07:52:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291161#M182191</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-05-31T07:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291162#M182192</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Ok, don't worry about. I suggest you taht keep your /var/adm/wtmp file into a sane size. Your size is out of recomended ranges and in any moment could being corrupted.&lt;BR /&gt;SAM/System Log Files/ Menu provide you options to keep a sane size of some important log files of your system.&lt;BR /&gt;&lt;BR /&gt;A trick to keep a trial of last user access if put in your /etc/prifile file the following sentence:&lt;BR /&gt;touch $HOME/.last_login&lt;BR /&gt;&lt;BR /&gt;With this the .last_login file placed into the each $HOME user directory will be updated with last login timestamp.&lt;BR /&gt;&lt;BR /&gt;Rgds</description>
      <pubDate>Mon, 31 May 2004 08:03:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291162#M182192</guid>
      <dc:creator>Jose Mosquera</dc:creator>
      <dc:date>2004-05-31T08:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291163#M182193</link>
      <description>Try this:&lt;BR /&gt;&lt;BR /&gt;for i in `cat /etc/passwd |awk -F: '{print $1}'`&lt;BR /&gt;do&lt;BR /&gt;finger $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Mon, 31 May 2004 13:10:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291163#M182193</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-05-31T13:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291164#M182194</link>
      <description>VERY IMPORTANT: wtmp has *NO* year information logged. You must truncate the file every few months. If not, last will report ghost logins and logins without logouts. This is a limitation of the wtmp file format and cannot be changed.</description>
      <pubDate>Mon, 31 May 2004 14:42:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291164#M182194</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-05-31T14:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291165#M182195</link>
      <description>Mr. Bill Hassel:&lt;BR /&gt;wtmp did have year information in it. you can try by invoking:&lt;BR /&gt;&lt;BR /&gt;cat /var/adm/wtmp | /usr/sbin/acct/fwtmp&lt;BR /&gt;&lt;BR /&gt;But I don't know how to display it.&lt;BR /&gt;&lt;BR /&gt;---&lt;BR /&gt;Mr. Jose Maria Mosquera:&lt;BR /&gt;I can't trim my wtmp, because there no recommended size for wtmp entry. &lt;BR /&gt;&lt;BR /&gt;/var/adm/wtmp  NA  34958520  NA&lt;BR /&gt;&lt;BR /&gt;should I manually trim it to a sane size ?&lt;BR /&gt;&lt;BR /&gt;rgds,&lt;BR /&gt;EF</description>
      <pubDate>Mon, 31 May 2004 20:09:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291165#M182195</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-05-31T20:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291166#M182196</link>
      <description>You are correct. The wtmp format is described in the wtmp man page. The date is stored in wtmp in binary. It is last (and lastb) that do not display the year.&lt;BR /&gt; &lt;BR /&gt;The wtmp (and utmp and btmp) file is binary so it cannot be trimmed, at least in a simple manner. Your example:&lt;BR /&gt; &lt;BR /&gt;cat /var/adm/wtmp | /usr/sbin/acct/fwtmp&lt;BR /&gt; &lt;BR /&gt;is the method to convert from the binary format into ASCII. The resultant ASCII file can then be manually edited. NOTE: There may be logins that span the date you choose so a simple truncation of the ASCII file may create ghost sessions in last. There isn't an easily scriptable method to truncate wtmp or btmp. The best choice is to copy wtmp into an archive directory, then zero the current wtmp file (at reboot).&lt;BR /&gt; &lt;BR /&gt;To accomplish the task to see who has not logged in for during the last 3 months, use fwtmp to format wtmp and search the the ASCII formatted output. wtmp and btmp grow without bounds so they can be very large, a good reason to zero this file every 3-6 months.</description>
      <pubDate>Mon, 31 May 2004 22:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291166#M182196</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-05-31T22:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291167#M182197</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;use this:&lt;BR /&gt;&lt;BR /&gt;# /usr/bin/last -R &amp;gt; /tmp/whologin&lt;BR /&gt;to create a file "whologin" of users who successfully login&lt;BR /&gt;# /usr/bin/lastb -R &amp;gt; /tmp/badlogin&lt;BR /&gt;to create a file "badlogin" of users who failed to login&lt;BR /&gt;&lt;BR /&gt;the file created are in descending order (earliest date first)&lt;BR /&gt;&lt;BR /&gt;as u have realise, there is no year to it, but u could&lt;BR /&gt;# /usr/bin/last -R -1000 &amp;gt; /tmp/last1000line_whologin&lt;BR /&gt;to create a file "last1000line_whologin" of the last 1000 successful login&lt;BR /&gt;&lt;BR /&gt;hope the above helps.&lt;BR /&gt;&lt;BR /&gt;regards.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 31 May 2004 23:57:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291167#M182197</guid>
      <dc:creator>Joseph Loo</dc:creator>
      <dc:date>2004-05-31T23:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: search inactive users</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291168#M182198</link>
      <description>Hi EMir,&lt;BR /&gt;&lt;BR /&gt;try this script, I checked this script and it gives me the year if it is not the current year.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;# Script to find out dormant users&lt;BR /&gt;&lt;BR /&gt;while read LINE;do&lt;BR /&gt;&lt;BR /&gt;# extract usernames and home directories from /etc/passwd&lt;BR /&gt;&lt;BR /&gt;        USER=$(echo $LINE|awk -F: '{print $1}')&lt;BR /&gt;        HOMEDIR=$(echo $LINE|awk -F: '{print $6}')&lt;BR /&gt;&lt;BR /&gt;# extract login info from finger using grep&lt;BR /&gt;&lt;BR /&gt;        LAST_LOGIN=$(finger ${USER}|grep -E 'Last login|Never logged')&lt;BR /&gt;&lt;BR /&gt;        echo "$USER\t$HOMEDIR\t$LAST_LOGIN"&lt;BR /&gt;done &amp;lt; /etc/passwd&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Mohan.</description>
      <pubDate>Tue, 01 Jun 2004 06:31:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/search-inactive-users/m-p/3291168#M182198</guid>
      <dc:creator>Mohanasundaram_1</dc:creator>
      <dc:date>2004-06-01T06:31:10Z</dc:date>
    </item>
  </channel>
</rss>

