Operating System - HP-UX
1820258 Members
3004 Online
109622 Solutions
New Discussion юеВ

last command says I am still logged in

 
Ratzie
Super Advisor

last command says I am still logged in

I posted a question regarding a bad last command. And I thought I had it working but now I have additional problems.
When I log out last still says I am logged in!

I made the mistake of clearing out the wtmp file utmp file.
>wtmp
>wtmp

Now I am running into problems with the last command.
It still says I am logged in when I am not.

# who
laura pts/0 Dec 10 11:29
laura pts/1 Dec 10 11:52

# last
laura pts/1 Wed Dec 10 11:52 still logged in
laura pts/1 Wed Dec 10 11:47 still logged in

wtmp begins Wed Dec 10 11:47

****Logged out***

# who
laura pts/0 Dec 10 11:29
# last
laura pts/1 Wed Dec 10 11:52 still logged in
laura pts/1 Wed Dec 10 11:47 still logged in

wtmp begins Wed Dec 10 11:47
# last
laura pts/1 Wed Dec 10 11:52 still logged in
laura pts/1 Wed Dec 10 11:47 still logged in

wtmp begins Wed Dec 10 11:47

Completely logged out of server and logged back in...

$ last
laura pts/0 Wed Dec 10 11:55 still logged in
laura pts/1 Wed Dec 10 11:52 still logged in
laura pts/1 Wed Dec 10 11:47 still logged in

wtmp begins Wed Dec 10 11:47


I went in and trimmed using sam, same problem.
I also did I reboot. That would clear the still logged in but I still have the same problem!
31 REPLIES 31
Steven E. Protter
Exalted Contributor

Re: last command says I am still logged in

Probably the user was logging in while you were clearing the file.

Seems strange whats going on.

Perhaps you need to check permissions on the wtmp file and completely delete it and rebuild it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sanjay_6
Honored Contributor

Re: last command says I am still logged in

Hi,

did you try a cat /dev/null > /var/adm/wtmp

This will clean all the info.

Hope this helps.

Regds
RAC_1
Honored Contributor

Re: last command says I am still logged in

Doing >/var/adm/wtmp would not cause problem.

Also check if you are up to date on WTMP patches.

Also look at fwtmp command.
There is no substitute to HARDWORK
Ratzie
Super Advisor

Re: last command says I am still logged in

Do I need to be at the console when I cleared this file?
I am the only one on the system. I am still at a loss!
Sanjay_6
Honored Contributor

Re: last command says I am still logged in

Hi,

You can trim the file to an acceptable size if you do not want to trim it to zero.

Take a look at this thread,

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000063200530

The doc id is KBRC00002527

Hope this helps.

Regds
RAC_1
Honored Contributor

Re: last command says I am still logged in

You need not be on console for doing this.

Post ll /var/adm/wtmp.

(I assume you doing all this by loggin in as root user)
There is no substitute to HARDWORK
Pete Randall
Outstanding Contributor

Re: last command says I am still logged in

Laura,

Here's what I get:


# >/var/adm/wtmp
# exit
$ last

wtmp begins Wed Dec 10 13:23
$ ll /var/adm/wtmp
-rw-rw-r-- 1 adm adm 0 Dec 10 13:23 /var/adm/wtmp
$



I had logged in as myself, su'd to root, and cleared the wtmp file. As you can see, it shows zero bytes and the last command returns nothing. Are you sure this is what you're doing?


Pete

Pete
Helen French
Honored Contributor

Re: last command says I am still logged in

You don't need to be in the console. From any telnet session:

# cd /var/adm
# > wtmp

Also, check for all latest patches for last command.
Life is a promise, fulfill it!
Sanjay_6
Honored Contributor

Re: last command says I am still logged in

Hi,

You don't have to be on the console to do this. you can do this from any telnet session itself.

Hope this helps.

Regds
Ratzie
Super Advisor

Re: last command says I am still logged in

Yes that is what I did!

$ last
lhradowy pts/0 Wed Dec 10 12:26 still logged in
lhradowy pts/0 Wed Dec 10 12:26 still logged in

wtmp begins Wed Dec 10 12:25
$ ll /var/adm/wtmp
-rw-rw-r-- 1 adm adm 240 Dec 10 12:26 /var/adm/wtmp
$


I also did cat /dev/null > /var/adm/wtmp

Still same problem...
I will look for patch...
RAC_1
Honored Contributor

Re: last command says I am still logged in

How abt this?

fwtmp < /var/adm/wtmp > /tmp/login.txt
>/tmp/login.txt
fwtmp -ic < /tmp/login.txt > /var/adm/fwtmp

>/var/adm/fwtmp

$last

Post the results.
There is no substitute to HARDWORK
Paula J Frazer-Campbell
Honored Contributor

Re: last command says I am still logged in

Laura

$ last
lhradowy pts/0 Wed Dec 10 12:26 still logged in
lhradowy pts/0 Wed Dec 10 12:26 still logged in


Times are the same? check your profile what is it doing?

Also having a second root level login is a security issue - it provides another superuser entrance - best to have only one root level user "root" and only use it as a last resort. Su to root if required from your normal working login.

Paula
If you can spell SysAdmin then you is one - anon
Ratzie
Super Advisor

Re: last command says I am still logged in

SAME PROBLEM!

# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/login.txt
# >/tmp/login.txt
# /usr/sbin/acct/fwtmp -ic /var/adm/wtmp
# date
Wed Dec 10 12:40:32 CST 2003
# >/var/adm/wtmp
# last

wtmp begins Wed Dec 10 12:40
# date
Wed Dec 10 12:40:58 CST 2003
# last
lhradowy pts/2 Wed Dec 10 12:41 still logged in
lhradowy pts/1 Wed Dec 10 12:41 still logged in

wtmp begins Wed Dec 10 12:41
Sanjay_6
Honored Contributor

Re: last command says I am still logged in

Hi,

Yes this is possible. Your profile might be calling a new shell within the profile.

Hope this helps.

Regds
Ratzie
Super Advisor

Re: last command says I am still logged in

I am trying to be as secure as possible.
I do not want second level user login.

How did I do that!
Ratzie
Super Advisor

Re: last command says I am still logged in

I have default profiles set up! I have not touch the profiles at all.

I did mv roots profile to /rootuser...
RAC_1
Honored Contributor

Re: last command says I am still logged in

> /etc/utmp

Post
There is no substitute to HARDWORK
Geoff Wild
Honored Contributor

Re: last command says I am still logged in

As RAC says - try it on utmp.

You might have to clean bad logins as well:

>/var/adm/btmp

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ratzie
Super Advisor

Re: last command says I am still logged in

Wed Dec 10 13:19:59 CST 2003
Still problem!
I can't find any patches regarding this as well.

# >/etc/wtmp
# last

wtmp begins Wed Dec 10 13:20
# last
lhradowy pts/1 Wed Dec 10 13:20 still logged in

wtmp begins Wed Dec 10 13:20
# last
lhradowy pts/1 Wed Dec 10 13:20 still logged in

wtmp begins Wed Dec 10 13:20
Ratzie
Super Advisor

Re: last command says I am still logged in

btmp does not work as well...
lastb
shows the current date! And does not log bad logins!

And yes I recreated it and still no go!

# date
Wed Dec 10 13:43:39 CST 2003
# lastb

btmp begins Wed Dec 10 13:43
Jdamian
Respected Contributor

Re: last command says I am still logged in

How do you log into the system ?

telnet ? Open-ssh ?
Ratzie
Super Advisor

Re: last command says I am still logged in

I have shut off all telnet r* related services. I am strictly runing ssh
Geoff Wild
Honored Contributor

Re: last command says I am still logged in

I think it's time to place a Support call with HP....

Let us know how it was resolved.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ratzie
Super Advisor

Re: last command says I am still logged in

I have spent endless hours trying to fix it, and I have duplicated it on another machine, so it is a bug problem...

Now, does HP have a link to address bug problems.... NO!

I was transfered 10 times before I found someone to talk to.

I have a case in with them.