LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 08-31-2004, 01:29 PM   #1
Law1213
Member
 
Registered: Jul 2004
Location: UK
Distribution: Gentoo
Posts: 52

Rep: Reputation: 17
Unhappy loging off a remote user


Hi,

I am replacing my Windows Terminal server with Linux. I am going to have multiple users accessing the linux server probably using XWin.exe from their windows machines to use Linux. Everything is pritty much setup however, before I start letting users login I want some security. I need the ability to log off a remote user at anytime. Any Ideas?

Also any ideas on monitoring remote users would be useful but mainly I need to know how to force a user to log off from the root console.

I have searched around and found very little about commands for logging off remote users, but there must be a way.

Any help is welcome,
Thanx in advance.

PS in the meantime I'll keep searching and if I find anything I'll do my best to make sure you know about it
 
Old 08-31-2004, 03:13 PM   #2
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
I don't think there is a specific command to log out users, but what always works is killing their login shell
Using the "w" command you can see who is logged in + their terminal (e.g. pts/1 if logged in over ssh)
Then use "ps", it has a switch to show all processes and the terminal they are running on (I forget, will have to look).
Matching these two gives you the processes and their numbers (PIDs) that are running at that terminal. Then shoot them into oblivion with "kill -9 <pid>"
 
Old 08-31-2004, 03:38 PM   #3
Law1213
Member
 
Registered: Jul 2004
Location: UK
Distribution: Gentoo
Posts: 52

Original Poster
Rep: Reputation: 17
Thumbs up

Thanks for the input it was very useful
 
Old 08-31-2004, 07:08 PM   #4
Law1213
Member
 
Registered: Jul 2004
Location: UK
Distribution: Gentoo
Posts: 52

Original Poster
Rep: Reputation: 17
Question

Hi,

I was also thought it might be useful to send the remote user a warning before logging them off, just a simple message so they can save their work.

Any thoughts?
 
Old 09-01-2004, 08:56 AM   #5
nukkel
Member
 
Registered: Mar 2003
Location: Belgium
Distribution: Hardened gentoo
Posts: 323

Rep: Reputation: 30
Hi,
Try the "write" command: write <username>
Then you can type a message; when done press Ctrl-D and it should appear on the user's terminal.

To do this in one command (e.g. in a script) pipe the message to it:
Code:
echo "You will be logged off in 5 minutes" | write johndoe
write can also take the terminal to send to as argument -- check "man write" for the entiry list of possibilities.

regards,
nukkel
 
Old 09-07-2004, 06:25 PM   #6
Law1213
Member
 
Registered: Jul 2004
Location: UK
Distribution: Gentoo
Posts: 52

Original Poster
Rep: Reputation: 17
Hi,

Thanks for the suggestion but when I attempt to use the write command I get "write: you have write permission turned off." any idea how to turn it on. btw tried as root also.
 
  


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
vsftpd will not jail remote user kipthomas Linux - Software 3 09-09-2005 11:38 PM
problem loging as user to fc3 shams Fedora 1 03-07-2005 04:09 AM
is last -i showing remote user logged in? b_s Linux - Security 8 03-05-2005 12:32 AM
loging in.. longbow99 Linux - Newbie 7 01-25-2005 12:02 AM
Remote User Login TuxFreak Linux - Networking 1 12-02-2004 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:58 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