Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
killall definitely does the trick, just su to a user (su <user>, hopefully not patronising you there) then open a root shell and try killall, and voila
Last edited by generic_genus; 01-04-2006 at 05:48 PM.
Great way of putting it, Tinkster. Now i get it: no shell, no "being logged in". To get back the shell, the user has to enter his password again. Problem solved!!
I never knew that there was a command "W". Thanks for the great help!
Another good way to logout a user logged in via ssh is to
issue the following command, especially if you don't wanna kill all the processes owned by that user
ps -ef|grep sshd
this will list the sshd processes running for each user logged in, killing the sshd for a particular user will obviously log him out.
No; it would kill all his processes. E.g. if he had fired up some
CPU intense app as night-processing in a screen session you'd
kill that along with the login-shells.
But that said:
killall -V
What do you get?
Because my killall doesn't know a -u option, I'd be using
skill -u user -c command
killall does have an option to kill by username, killall -u foo, kills all of user foos processes logging them out in effect. I have now noticed the difference of doing "ps -ef|grep sshd", I'm sorry for the misunderstanding it appears I didn't even read the command as I believed it did something entirely different so now I'ver made a fool of myself :P I'll blame the late hour.
P.S the version info for killall as requested, what version are you using then?
killall (PSmisc) 21.9
Copyright (C) 1993-2005 Werner Almesberger and Craig Small
Mine comes with procps-3.2.3, its version number is 21.4.
[edit]
I'm seriously confused now ...
I downloaded and installed the latest procps from http://procps.sourceforge.net/download.html
(3.2.6) and my killall still doesn't have a
-u option ... what distro are you running? They're
obviously patching stuff into that program that the
original author didn't intend to be there. In fact,
a killall -V of the latest still gives a 21.4.
[/edit]
I'm running an unstable gentoo, and the version of prcps installed is 3.2.6. Looking at the installation output there are no patches applies whose name would suggest adding this functionality, only ones for solving build issues on different architectures adn some unrelated features. And the source package is the same as the version downloaded off procps homepage (compaing md5sums), perhaps configure flag settings? though I don't see why this would cause the version change. This is a bit weird.
if your interested these are the patches applied:
emerge procps
* Applying 3.2.5-top-sort.patch ... [ ok ]
* Applying procps-3.2.5-proc-mount.patch ... [ ok ]
* Applying procps-mips-define-pagesize.patch ... [ ok ]
* Applying procps-3.2.6-mips-n32_isnt_usable_on_mips64_yet.patch ... [ ok ]
Last edited by generic_genus; 01-06-2006 at 06:09 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.