<?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: Determining last user logon in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402554#M201109</link>
    <description>IF the user logged on since the last time the /var/adm/wtmp file was cleared.&lt;BR /&gt;&lt;BR /&gt;last &lt;BR /&gt;&lt;BR /&gt;will show it.&lt;BR /&gt;&lt;BR /&gt;If not, passwd -sa might provide some useful data or some other variation, though this may only show the last time they changed their password. That isn't useless, may be helpful.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
    <pubDate>Mon, 18 Oct 2004 12:14:37 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2004-10-18T12:14:37Z</dc:date>
    <item>
      <title>Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402551#M201106</link>
      <description>I administer a trusted system (all password entries in /tcb/files/auth/*), and need some way to determine the last logon of all users in /etc/passwd for a particular system.&lt;BR /&gt;&lt;BR /&gt;Is there any way to use the u_suclog field in the tcb encrypted file or ANY other way to determine for each user in /etc/passwd when their last logon was?  We are going to use this for clean up purposes on the system..... Any assistance is GREATLY appreciated..</description>
      <pubDate>Mon, 18 Oct 2004 12:03:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402551#M201106</guid>
      <dc:creator>Clifton Smith</dc:creator>
      <dc:date>2004-10-18T12:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402552#M201107</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can use command for each user:&lt;BR /&gt; &lt;BR /&gt;last user_name  | head -n1</description>
      <pubDate>Mon, 18 Oct 2004 12:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402552#M201107</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-10-18T12:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402553#M201108</link>
      <description>Would the "last" command work for you?&lt;BR /&gt; &lt;BR /&gt;I've merged the output of "last" with "/etc/passwd" via a perl program and have generated such lists for myself.&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 18 Oct 2004 12:10:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402553#M201108</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-18T12:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402554#M201109</link>
      <description>IF the user logged on since the last time the /var/adm/wtmp file was cleared.&lt;BR /&gt;&lt;BR /&gt;last &lt;BR /&gt;&lt;BR /&gt;will show it.&lt;BR /&gt;&lt;BR /&gt;If not, passwd -sa might provide some useful data or some other variation, though this may only show the last time they changed their password. That isn't useless, may be helpful.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Oct 2004 12:14:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402554#M201109</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2004-10-18T12:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402555#M201110</link>
      <description>last userid&lt;BR /&gt;&lt;BR /&gt;last userid |head -1&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Oct 2004 12:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402555#M201110</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-10-18T12:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402556#M201111</link>
      <description>Here is the perl program I used-&lt;BR /&gt; &lt;BR /&gt;#!/usr/local/bin/perl&lt;BR /&gt;# Show last logins for every user in /etc/passwd&lt;BR /&gt;#&lt;BR /&gt;open(LASTLOGIN,"last|") || die "Can not run 'last' command\n";&lt;BR /&gt;while (&lt;LASTLOGIN&gt;) {&lt;BR /&gt;  next if $_ eq "";&lt;BR /&gt;  if (/^wtmp begin/) {$begin=$_ ; next};&lt;BR /&gt;  ($name,$tty,$date)=/(\S+)\s+(\S+)\s+(\S+\s+\S+\s+\S+)/;&lt;BR /&gt;  $user{$name}=$date unless $user{$name};&lt;BR /&gt;}&lt;BR /&gt;print $begin;&lt;BR /&gt;close(LASTLOGIN);&lt;BR /&gt;open(PASSWD,"/etc/passwd") || die "Can not open '/etc/passwd'\n";&lt;BR /&gt;while (&lt;PASSWD&gt;) {&lt;BR /&gt;  next if /^\+/;&lt;BR /&gt;  ($name,$rest)=split(":");&lt;BR /&gt;  $user{$name}="**NOT USED**" unless $user{$name};&lt;BR /&gt;}&lt;BR /&gt;foreach $name (sort keys(%user)) {&lt;BR /&gt;  printf "%-10s %s\n",$name,$user{$name};&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;/PASSWD&gt;&lt;/LASTLOGIN&gt;</description>
      <pubDate>Mon, 18 Oct 2004 12:19:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402556#M201111</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-18T12:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402557#M201112</link>
      <description>Rod - Thanks !!  This is just what I needed..... I would like to press my luck to ask one more thing, however.  I am not very familiar with Perl, and I would like to know how to narrow down the search in /etc/passwd to users with a specific word in their logon path.. For instance, in the POSIX world, it would look something like "grep (string) /etc/passwd".  I am unfamiliar with how to insert this into the Perl script that you have submitted.  Are you, or anyone in this thread, familiar enough with Perl to add some insight?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 18 Oct 2004 13:08:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402557#M201112</guid>
      <dc:creator>Clifton Smith</dc:creator>
      <dc:date>2004-10-18T13:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402558#M201113</link>
      <description>If you look at the line&lt;BR /&gt; &lt;BR /&gt;next if /^\+/;&lt;BR /&gt; &lt;BR /&gt;This statement skips those lines that begin with "+". What ever regular expression can be used. Example-&lt;BR /&gt; &lt;BR /&gt;To ignore users who are using ksh.&lt;BR /&gt;next if /bin\/ksh/;&lt;BR /&gt; &lt;BR /&gt;You could also replace the follwing split statement with-&lt;BR /&gt;($user,$pswd,$uid,$gid,$comment,$path,$shell)=split(":",$_);&lt;BR /&gt; &lt;BR /&gt;Then do comparisons on the a field-&lt;BR /&gt;next unless $comment=~/test/;&lt;BR /&gt; &lt;BR /&gt;Would only keep entries with "test" in the comment field (note "unless" clause). &lt;BR /&gt; &lt;BR /&gt;Perl is the swiss army knife for system admins.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Mon, 18 Oct 2004 13:28:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402558#M201113</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-10-18T13:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402559#M201114</link>
      <description>An easier, and quicker way to get the last login is:&lt;BR /&gt;&lt;BR /&gt;# /usr/lbin/getprpw -m ulogint user_id&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Oct 2004 13:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402559#M201114</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2004-10-18T13:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402560#M201115</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can use shell script:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;for user in `cat /etc/passwd | awk -F':' '{print $1}'`&lt;BR /&gt;do&lt;BR /&gt;  RES=`last $user | head -n1`&lt;BR /&gt;  [ "$RES" = "" ] || echo $RES&lt;BR /&gt;done</description>
      <pubDate>Tue, 19 Oct 2004 02:01:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402560#M201115</guid>
      <dc:creator>Slawomir Gora</dc:creator>
      <dc:date>2004-10-19T02:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Determining last user logon</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402561#M201116</link>
      <description>Patrick, did you mean slogint instead of ulogint? (successful vs. unsuccessful)</description>
      <pubDate>Tue, 19 Oct 2004 17:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/determining-last-user-logon/m-p/3402561#M201116</guid>
      <dc:creator>doug hosking</dc:creator>
      <dc:date>2004-10-19T17:47:09Z</dc:date>
    </item>
  </channel>
</rss>

