LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-24-2005, 11:41 PM   #1
lomnhom
Member
 
Registered: Jan 2005
Location: Ha Noi, Viet Nam
Distribution: Fedora Core
Posts: 61

Rep: Reputation: 15
log file, help me


I use FC2 and i'd like to write log file all commands that user use when they telnet to my box. How can i do.

Help me, plz.
 
Old 06-25-2005, 07:51 PM   #2
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
You will need support for that in your shell. If users use bash, they have a .bash_history in their home directory. You can prevent users from using other shells. .bash_history is however not reliable, and can be avoided (even deleted) by users.

NOTE: make sure users get a legal message saying something like 'Unauthorized access prohibited. All the contents of this session will be logged. Usage implies that you agree to the terms of service.'

The only way to do what you want is to log the whole connection (I know it can be done, but not how). this may prove to be useless, and even problematic, especially if a user screws up and does something like:
cd /; ls -R . Or, even worse, if he uses a full-screen application (emacs -nw, nano. pico, vi, any editor) you will get loads of junk dumped in your log file. A user may even use this to hide malicious activities (ex. he could use the shell-exec feature in an editor to hide the malicious command in the middle of the editor garbage. He could also do 'nano badcommands.sh; ./badcommands.sh' to hide the commands.

Look at http://archives.neohapsis.com/archiv...9-q4/0224.html

SSH has a flag to turn this on (man sshd.config):
Quote:
LogLevel
Gives the verbosity level that is used when logging messages from
sshd. The possible values are: QUIET, FATAL, ERROR, INFO, VER-
BOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3. The default is INFO.
DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify
higher levels of debugging output. Logging with a DEBUG level
violates the privacy of users and is not recommended.
Note: I don't know how this works with full-screen editors.

Also, don't use telnet, it sends passwords in cleartext.

Last edited by stefan_nicolau; 06-25-2005 at 08:18 PM.
 
  


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
Log file macadam Linux - Networking 2 06-12-2005 06:23 AM
How to control log file size in /var/log? yan Linux - General 2 10-13-2003 05:00 PM
what log file generator that support squid log? heero82 Linux - Software 2 07-11-2003 08:52 PM
^M throughout log file chris.harris Linux - Software 1 07-09-2003 08:24 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

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

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