The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

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 idle user script michieka UNIX for Dummies Questions & Answers 4 05-24-2002 06:47 AM
logoff ghost user phpote UNIX for Dummies Questions & Answers 4 07-24-2001 06:46 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-28-2005
balaji_prk's Avatar
Registered User
 

Join Date: Aug 2005
Location: NewDelhi
Posts: 44
Exclamation Logoff a user...

Hi...

could anyone tell me how to kill a user session on my server with out affecting other user?

Bala
Reply With Quote
Forum Sponsor
  #2  
Old 11-29-2005
Registered User
 

Join Date: Nov 2001
Location: Flint, MI
Posts: 186
I use this to grab their PID :
ps -ef | grep userid
Then kill -kill PID
Reply With Quote
  #3  
Old 11-29-2005
balaji_prk's Avatar
Registered User
 

Join Date: Aug 2005
Location: NewDelhi
Posts: 44
thank for the reply..

is there any other command other than killing that particular userid?

Bala
Reply With Quote
  #4  
Old 12-01-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,262
Quote:
Originally Posted by balaji_prk
thank for the reply..

is there any other command other than killing that particular userid?

Bala
You do not "kill the userid", but kill the login session she is using. Instead of using "ps -fe | grep <userid>" you can also use "ps -fu <userid>" btw., which lists all processes owned by the specified userid.

bakunin
Reply With Quote
  #5  
Old 12-03-2005
balaji_prk's Avatar
Registered User
 

Join Date: Aug 2005
Location: NewDelhi
Posts: 44
hi bakunin

the method u explained is correct.. But i will explain the scenario..
suppose at any instance when i run the who command and i found an unauthorized user logged in to my server and i should log him out at the earliest. what am i supposed to do? i know his username... so is there any command by which i could kill his session using his username? sorry if am stupid...

Bala
Reply With Quote
  #6  
Old 12-04-2005
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,262
I don't get it - if a user has a userid she is supposed to be authorized, yes?

If you want to disable the ability of a userid to log in, but still want to keep the userid you can disable his right to log on to the machine. The information rests in the ODM and can be listed with the "lsuser" and changed with the "chuser" command. Here is a sample output of "lsuser":

Code:
# lsuser f985905
f985905 id=23996 pgrp=staff groups=staff,system,security,ddm001r home=/home/f985905 shell=/usr/bin/ksh 
gecos=myuser, CS3 AIX-Administration Team login=true su=false rlogin=true daemon=true admin=true 
sugroups=ddm001r,ALL tpath=on ttys=ALL expires=0 auth1=SYSTEM auth2=NONE umask=77 registry=files SYSTEM=files 
loginretries=5 pwdwarntime=14 account_locked=false minage=0 maxage=13 maxexpired=0 minalpha=1 
minother=1 mindiff=3 maxrepeats=2 minlen=7 histexpire=0 histsize=9 fsize=2097151 cpu=-1 data=131072 
stack=32768 core=1024 rss=32768 nofiles=2000 core_hard=1024 time_last_login=1133704370 
time_last_unsuccessful_login=1133183860 tty_last_login=ssh tty_last_unsuccessful_login=/dev/pts/1 
host_last_login=130.24.110.41 host_last_unsuccessful_login= unsuccessful_login_count=0 roles=ManageBasicUsers,ManageAllUsers,ManageBasicPasswds,ManageAllPasswds,ManageRoles,ManageBackupRestore,ManageBackup,ManageShutdown,RunDiagnostics,ManageDiskQuota
I have marked bold the parts which are interesting to you. By setting any of these values appropriately you can lock the user out of the machine:

Code:
# chuser -a login=false f985905
# chuser -a account_locked=true f985905
...etc
This would, of course only prevent further logins, to get the user out of the machine immediately look up her processes by ps -fu like mentioned above and kill these processes. In the example above that would be:

Code:
# ps -fu f985905
     UID    PID   PPID   C    STIME    TTY  TIME CMD
 f985905 581780 696398   0 14:53:02  pts/1  0:00 -ksh 
 f985905 671978 729222   0 14:52:50  pts/0  0:00 -ksh 
 f985905 729222 811062   0 14:52:50      -  0:00 sshd: f985905@pts/0 
 f985905 696398         1   0 13:27:22  pts/2  0:00 -ksh 
# kill -9 696398
Hope this helps

bakunin

Last edited by bakunin; 12-04-2005 at 04:44 PM.
Reply With Quote
  #7  
Old 12-05-2005
balaji_prk's Avatar
Registered User
 

Join Date: Aug 2005
Location: NewDelhi
Posts: 44
That really helped... Thanks a lot...
Well I have got one more doubt and am posting it as a new thread,
so that it helps.

Bala
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:54 PM.


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

Content Relevant URLs by vBSEO 3.2.0