LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 02-05-2005, 04:29 PM   #1
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Rep: Reputation: 30
allow ssh then kill the programme


Hello i was wandering if i allow some one to use ssh on my computer is it possible to watch what they are doing and then if i decided i did not want them on any more how would i kill the programme, im running suse9.1 .
thanks nige
 
Old 02-05-2005, 07:04 PM   #2
MikeOliveri
LQ Newbie
 
Registered: Feb 2005
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
The "w" command will tell you who's logged in, where from, and what they're currently doing:

19:01:45 up 22:43, 1 user, load average: 0.27, 0.29, 0.21
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
mike tty1 - Fri20 22:38m 0.29s 0.04s /bin/sh /usr/X

You can also run "ps waux | grep username" to see what they're doing, which will also find their SSH session. From there you can use kill (or kill -9) to stop whatever they're doing. You'll need to take steps to keep them from logging back in, though, such as changing their login shell to an invalid one, shutting down SSH, or blocking them at the firewall or with /etc/hosts.allow or /etc/hosts.deny.

Take care,
Mike
 
Old 02-05-2005, 07:50 PM   #3
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Thanks very much for your answer is it possible you could show me an example of the w command please thanks nige
 
Old 02-05-2005, 08:04 PM   #4
MikeOliveri
LQ Newbie
 
Registered: Feb 2005
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
You're actually looking at it up in my reply. Just type w and click enter at the command line and you'll see what I typed. It'll be a little more readable on the command line than what you see above. For someone logged in remotely, you'll see an IP address or domain name rather than tty1, which is someone logged in locally.

Take care,
Mike
 
Old 02-06-2005, 02:17 AM   #5
master
Member
 
Registered: Oct 2003
Location: Birmingham/Eng/UK
Distribution: /Debian3.1/suse/XP/Win7
Posts: 677

Original Poster
Rep: Reputation: 30
Thats great cheers very much
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to tell a C++ programme to quit ? yogeshm02 Programming 3 09-09-2005 05:59 AM
Email Registration Programme sathu Programming 2 02-27-2004 05:19 AM
how to access ftp using c++ programme ? mphreddy Programming 1 10-28-2003 03:01 AM
SQUID Customized Authentication Programme ritesh_aladdin Linux - Software 0 07-25-2003 08:08 AM
how can I modify this programme? wwnn1 Programming 5 05-14-2002 07:55 AM


All times are GMT -5. The time now is 08:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration