LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-02-2005, 01:19 PM   #1
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Rep: Reputation: 30
How do I "kick" a user who is logged in?


For example, if I work as "root" and as "usertest" at the same time and want to logout the "usertest" through the "root" account. I tried logout but it only works for the current user and there is no manual... Any suggestions?

Also: is there any way to disable a user accout temporarily without deleting it, so as the user may not login untill I re-activate their account (without losing the user's data)?

Thanks in advance
 
Old 06-02-2005, 01:24 PM   #2
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 253

Rep: Reputation: 34
When a process starts, a PID (process id)is spawned. If you give a ps ax it will list all processes running on the system. As root you can kill a process id eg kill ##### (replace the ##### signs with the number corresponsing to the appropriate process id.)
 
Old 06-02-2005, 01:27 PM   #3
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
Err... I think this has little to do with what I asked...
 
Old 06-02-2005, 01:33 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by LinuxSeeker
Err... I think this has little to do with what I asked...
What's he's trying to tell you is that you can simply kill their bash process or whatever shell they use that is spawned and used to login with..
 
Old 06-02-2005, 01:38 PM   #5
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
What if they are logged in normally (Mandrake normally) with KDE?
 
Old 06-02-2005, 02:04 PM   #6
BmxFace
Member
 
Registered: Jun 2003
Location: Minnesota
Distribution: Arch Linux :D
Posts: 105

Rep: Reputation: 15
regardless of what you use to log in you login with a bash. even if it has a pretty login manager
 
Old 06-02-2005, 02:19 PM   #7
apolinsky
Member
 
Registered: Oct 2004
Location: Brooklyn
Distribution: Slackware 13.1,12.1,12.2; Debian Sqeeze; Centos 5,6
Posts: 253

Rep: Reputation: 34
Just to amplify a bit. Linux or Unix treats everything as a file. A disk is a file with certain characteristics. A tape is also just a file. It is the beauty of Unix. It is abstract, but in its own way wonderful.

In order to run Samba creates a process, as does a user logging in, as does kde, gnome etc. When you give a ps ax it will list ALL processes running in the system. Root can kill any of them. If you would like to learn more about the commands you could open a terminal window and issue man kill or man ps. If you are not sure of what command you need, you could try apropos and ???. Replace the ??? with the reference you are looking for. Good luck and welcome to the world of Linux.
 
Old 06-02-2005, 03:06 PM   #8
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally posted by LinuxSeeker
What if they are logged in normally (Mandrake normally) with KDE?
Normally? What's a normal login?

Even when a user logs in thru the Graphical Interface, its still using a shell or some sort..
 
Old 06-02-2005, 03:54 PM   #9
RandomLinuxNewb
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
To lock an account use usermod.
Code:
usermod -L username
To unlock the account
Code:
usermod -U username
 
Old 06-02-2005, 04:09 PM   #10
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Just to add some more detail:
You need to kill the parent process for that user - it will be the one with the lowest PID owned by that user for that particular tty.
 
Old 06-03-2005, 02:03 AM   #11
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Hi

To log out a user:
Code:
skill -u username
Only try this for normal users. For system users, you'll take down half the system in the process.

Locking and unlocking an account can also be done with
Code:
passwd -l username
passwd -u username
respectively

Groetjes,

Kees-Jan
 
Old 06-03-2005, 07:47 AM   #12
LinuxSeeker
Member
 
Registered: Feb 2004
Location: Linuxland
Distribution: Ubuntu 5.10, KUbuntu 5.10, Mandrake 10.1 - Ubuntu 5.04 (Hoary)
Posts: 346

Original Poster
Rep: Reputation: 30
Quote:
Normally? What's a normal login?
Even when a user logs in thru the Graphical Interface, its still using a shell or some sort..
I guess I was not as precise as I should be... I meant that all users in my computer use the KDE graphic login manager and I was wondering if in such a case there are any differences.

Quote:
Originally posted by RandomLinuxNewb
To lock an account use usermod.
Code:
usermod -L username
To unlock the account
Code:
usermod -U username
Thanks, this works great.

Quote:
Originally posted by kees-jan
Hi
To log out a user:
Code:
skill -u username
Only try this for normal users. For system users, you'll take down half the system in the process.
I tried to use it on a normal user but it fails. There are no error messages and everything seems to work fine, however when I press ctrl+alt+F2 to check if it worked, the user is still there and nothing seems to have changed... The manual was not of great help, what now?

The password lock works fine.

Quote:
Originally posted by apolinsky
Good luck and welcome to the world of Linux. [/B]
Thank you but I have been using Linux for nearly two years now , although it is the first time I want to be able to use my computer without using the GUI not for a single action. Thanks again.

Last edited by LinuxSeeker; 06-03-2005 at 07:50 AM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chrooted user: "write" and "talk" don't work. ldp Linux - Software 2 04-12-2005 02:05 AM
User "list" running process "python" TroelsSmit Linux - Newbie 2 02-22-2005 04:55 AM
"User" & "System" CPU load difference JJX Linux - General 3 06-06-2004 01:42 AM
Shorten a Qmail user name to "user" instead of "user@domain.com" anorman Linux - Software 0 12-12-2003 08:29 AM
how do I "kick" a user off Redhat 9? jdruin Linux - Security 24 08-02-2003 02:42 PM


All times are GMT -5. The time now is 05:46 PM.

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