LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2003, 08:52 AM   #1
acid2000
Member
 
Registered: Nov 2001
Location: Exeter, UK
Distribution: Gentoo 1.4
Posts: 243

Rep: Reputation: 30
killing a users ssh session


How do you kill someone elses ssh session?
 
Old 03-17-2003, 09:04 AM   #2
acid2000
Member
 
Registered: Nov 2001
Location: Exeter, UK
Distribution: Gentoo 1.4
Posts: 243

Original Poster
Rep: Reputation: 30
You kill their ssh session.
 
Old 03-17-2003, 09:23 AM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
by finding the pid and killing it find out what pty terminal they are on (pty/#) and then look that pty terminal up in the process manager, and kill the pid with the ppid of 1 on that terminal, note i'm not sure, but i don't think stopping the sshd will affect any established connectcions, only prevent new ones
 
Old 03-17-2003, 09:59 AM   #4
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
ps aux -ww|grep $username |grep -v grep|grep sshd


will return something like:


m0rl0ck 1636 0.0 1.4 6048 1824 ? S 10:49 0:00 /usr/sbin/sshd


The second feild above is the PID so just :

kill -9 1636

or what ever the number happens to be.
 
Old 03-17-2003, 10:05 AM   #5
acid2000
Member
 
Registered: Nov 2001
Location: Exeter, UK
Distribution: Gentoo 1.4
Posts: 243

Original Poster
Rep: Reputation: 30
Found the answer for my question, thanks anyway.
 
Old 03-17-2003, 10:13 AM   #6
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
Quote:
Found the answer for my question, thanks anyway.

What was it?

If you didnt kill it by pid how did you do it?
 
Old 03-17-2003, 10:17 AM   #7
doublefailure
Member
 
Registered: Mar 2002
Location: ma
Distribution: slackware
Posts: 747

Rep: Reputation: 30
i think he meant he found similar solution somewhere else and saw your answer
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Killing an SSH Session chatmasta Linux - Networking 5 05-27-2015 02:51 AM
persistent ssh session apepost Linux - Networking 4 11-12-2005 12:16 AM
[bash] killing processes using ssh Erhnam Programming 13 01-31-2005 11:56 PM
copying kde configuration for 2 users OR 2 users on 1 x session for vnc blackphiber Linux - General 0 02-26-2004 08:57 PM
Killing an X session twistedpair Linux - Security 1 01-07-2004 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:37 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration