Go Back   Web Server Hosting Forum by BODHost > Support > Tutorials and Documentation
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-08, 13:59
BOD Member
 
Join Date: Jul 2007
Posts: 296
Default How to Kill user in Linux

saw a post where a guy had his server infected with a bunch of perl bots si i figure id help

Well if you want to kill some users process ( in unix/linux hosting server) or if you want to terminate from the shell access then you can use following commands.

If you want the user jason’s process details

ps -aux |grep jason

from the output just kill the process id of that user and that user will be out from the shell without any wall message for him/her.

By other way you can do following.

Task: How to halt/stop user called jason

Type the skill command as follows:
# skill -STOP -u jason

You muse be root to stop other users.
Task: How to resume already halted user called jason

Send CONT single to user jason, type the following command:
# skill -CONT -u jason
Task: How to kill and logout user called jason

You can send KILL single, type the following command:
# skill -KILL -u jason
Task: Kill and logout all users

The ultimate command to kill and logout all users, type the following command:
# skill -KILL -v /dev/pts/*

Please note that send users warning message or logout notice using wall command to avoid data loss.

Enjoy..
__________________
insert sig here
Reply With Quote
  #2 (permalink)  
Old 04-21-08, 04:46
sam sam is offline
BOD Member
 
Join Date: Jul 2007
Posts: 141
Send a message via Yahoo to sam
Default

You can also try this one

1) ps -ef | grep "postgres"
see which users are connectioned and than.
2) pkill -f 'postgres: postgres <databasename>';

its more safer i suppose than kill -9
Reply With Quote
  #3 (permalink)  
Old 04-22-08, 04:54
BOD Member
 
Join Date: Mar 2006
Location: Scotland
Posts: 201
Default

To kill all processes for a single user, use the following command:

pkill -u username
Reply With Quote
  #4 (permalink)  
Old 04-23-08, 09:25
BOD Member
 
Join Date: Jul 2007
Posts: 128
Default

How do I Know who is logged in to kill them?
Reply With Quote
  #5 (permalink)  
Old 04-23-08, 09:48
BOD Member
 
Join Date: Nov 2005
Posts: 206
Default

just type "who" at the console
Reply With Quote
  #6 (permalink)  
Old 10-10-08, 15:33
BOD Member
 
Join Date: Oct 2008
Posts: 30
Default

You can also check the current logged in user name as well as user local machine ip address or network name in your server by using following command

Quote:
root@yourserverhostname]# w
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
test1 pts/2 ipaddress 19:34 45:47 0.01s 0.01s sshd: test1
test2 pts/4 ipaddress 20:04 0.00s 0.05s 0.01s sshd: test2
__________________
Regards
George
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 01:58.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.