The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to apply the awk commnad ? preethgideon UNIX for Dummies Questions & Answers 3 10-30-2006 05:32 PM
sorting file and unique commnad.. amon Shell Programming and Scripting 2 02-16-2006 01:19 AM
grep commnad props Shell Programming and Scripting 5 12-14-2004 03:50 PM
Commnad for getting bandwidth usage skotapal UNIX for Dummies Questions & Answers 5 01-16-2003 04:47 AM
How does commnad tail implement chenhao_no1 High Level Programming 1 08-22-2002 10:13 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2008
Registered User
 

Join Date: Nov 2007
Posts: 21
User History and commnad log

Dear All

I had a UNIX ( Sun solaris ) os.

There are many user on that server. Now i want to find during last week who had log in to the sever and which commnad are executed by them?

I also want to from which IP they had log in to the server.

Is there any log file generated for user in server.??? Kindly send me path.

Hoping reply

Regards
Jaydeep
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-09-2008
HPAVC's Avatar
Registered User
 

Join Date: Feb 2008
Posts: 105
If your running the acct packages there your good to go for doing just that, that gives you quite a bit extra commands like lastcomm and what not to show command history and more.

Though most intrusions avoid utmp/wtmp pretty handedly
Reply With Quote
  #3 (permalink)  
Old 02-10-2008
otheus's Avatar
Registered User
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 191
Use "last" to see who's logged in

The command you want is "last". It uses the information from wtmp, which after 30 days gets moved to /var/adm/wtmpx.1 or something like that.

Use last by itself to get the standard report. Remote logins will have the IP address in the 3rd column. (Locally spawned sessions, ie, Xterms or virtual terminals will not have an IP address.) Use -f filename to use the older wtmpx file.

As the previous poster hinted at, hackers may be able to cover their tracks, so this only helps with authorized access. To cross-reference, you can also look at the logs from /var/adm/messages*. To enable more verbosity in log messages, you should tweak entries in both /etc/pam.conf, /etc/syslogd.conf, and /etc/ssh/sshd.conf.
Reply With Quote
  #4 (permalink)  
Old 02-10-2008
HPAVC's Avatar
Registered User
 

Join Date: Feb 2008
Posts: 105
Quote:
Originally Posted by otheus View Post
The command you want is "last". It uses the information from wtmp, which after 30 days gets moved to /var/adm/wtmpx.1 or something like that.
last only gives logins, but lastcomm gives oh much more. Though I never found it all that wonderful in practice. A simply ln -s /usr/bin/games/rogue ~/bin/pine and you could be productive all day long
Reply With Quote
  #5 (permalink)  
Old 02-10-2008
Registered User
 

Join Date: Nov 2007
Posts: 21
use command log

Dear all

I also want to log of command given by specific user.

Kindly sugest me....

lastcomm command is not runing in my system..

plz send other possible way...
Reply With Quote
  #6 (permalink)  
Old 02-11-2008
otheus's Avatar
Registered User
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 191
There's another thread on this board about command logging. There's the "rootsh" package (available from sourceforge), but you have to replace selected user's shells. If you're running BSD, the lastcomm package will work if accounting is turned on (apparently). If you're running Solaris, there's an accounting and reporting package there too (see other thread).
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0