The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running a script during logoff praveenkumar_l UNIX for Advanced & Expert Users 3 06-13-2007 02:58 AM
list the names of users who logoff in last 4 minutes jax_anchal Shell Programming and Scripting 2 10-03-2006 04:07 AM
Apparent logoff’s due to inactivity. gadgetman SCO 0 08-29-2006 07:07 PM
Logoff a user... balaji_prk AIX 6 12-05-2005 09:03 AM
logoff idle user script michieka UNIX for Dummies Questions & Answers 4 05-24-2002 06:47 AM

Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2001
Registered User
 

Join Date: Jul 2001
Location: Sao Paulo, Brasil
Posts: 6
Wink logoff ghost user

I just noticed by running a who command that I was logged in twice . So two admin2 are on the list. (solaris 2.6)
Since I telnet using a windows 98, I suppose that I forgot to CTRL-D last time I logged in and clicked on hangup.
In such a case, how can I loggoff the old ghost loggin ?
It's not a process so cannot use KILL, or can I ?
Securitywise, it does not look so wise to have an open loggin.

Thanks for your enlightments.

__________________
Regards from Phpote
Forum Sponsor
  #2 (permalink)  
Old 07-24-2001
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
kill -9`ps -ef|grep $user|grep (pts/??|tty?)|awk '{ print $2 }'`

there ya go. all you need to know is the user and the pts or tty you want to knock off. ;} even zombie prossesses have a proccess id (i beleave)
  #3 (permalink)  
Old 07-24-2001
mod mod is offline
Registered User
 

Join Date: Jul 2001
Location: Vienna
Posts: 29
when you type in who you'll see your username and the terminal you're using ... eg:

admin2 ttyp1
admin2 ttyp3

with a second command "who am i" you can find out the terminal you re using in the moment:
admin2 ttyp3 ....

so you know that ttyp1 was the terminal from before ... search for processes running on that terminal:
ps -ft ttyp3

then you can kill all processes running under this terminal.

BUT: I can be that who is still showing you logged in ... never found out when and why this information is not leaving

BUT #2: If there are no processes runnning it makes no difference if who is showing you logged in or not.
The only point which could be important is that you lose one number from the number of maximal ttys.
  #4 (permalink)  
Old 07-24-2001
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
for sakes of argument if you do a "w" and get the list of users loged in (which reflects from /var/adm/wtmp) and you noticed that there are no process running you can just wipe out that file but in that process you would also lose anyinfo for anyone logged in. you can also use the last command to see if it is actually still logged in (if it is it should most deffinetly have a PID.)

if it is showing up it has to have a pid zommbied or not.

Code:
man last

The last  command looks in the  /var/adm/wtmpx  file,  which
     records  all  logins  and  logouts,  for information about a
     user, a terminal, or  any  group  of  users  and  terminals.
     Arguments  specify  names of users or terminals of interest.

man utmp
The utmp database file contains user access  and  accounting
     information  for  commands  such  as  who(1),  write(1), and
     login(1). The wtmp file contains the history of user  access
     and accounting information for the  utmp database. The data-
     base contained in these files can be manipulated  using  the
     getutent() family of functions.  Entries in the database are
     described  by  the  definitions  and  data   structures   in
     <utmp.h>. See getutent(3C).
please correct me if i am wrong.
  #5 (permalink)  
Old 07-24-2001
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Wouldn't it be safer to do a `kill -1` or `kill -HUP` on each of those idle or zombie sessions? I suppose that a -15 or -9 would be needed in some cases, but if you made a mistake, it would be easier to recover from
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0