Sponsored Content
Top Forums UNIX for Advanced & Expert Users Capturing commands executed by user Post 302091223 by bhaven.haria on Saturday 30th of September 2006 03:48:59 AM
Old 09-30-2006
Lightbulb Capturing commands executed by user

Hello Unix Champs,

For keeping audit trail, I want to log the commands entered by the normal users, on their terminal into a text file.

I tried putting a "script -a username.timestamp.txt" in the user profile file, but script command stops execution when user types exit or presses CTRL+D during his session and shows him message "Scripting Done". Obviously, All commands typed by user after this message, will not be logged in the log file.

My queries:
1) Can I control the execution of the script program in such a way that whenever user types "exit", he will exit from the system?
2) Is there any other way by which I can capture what commands user types ?

Thanks,
Bhaven
 

10 More Discussions You Might Find Interesting

1. Solaris

I want to know whole day commands executed by particular user

Hi all I want to know the commands executed a by particular user .. for the whole day on my machine. I have checked out with the commad $lastcomm <user> It is throwing an error called: .. /var/adm/pacct: No such file or directory Can u help me in this regard.. Thank U... (3 Replies)
Discussion started by: naree
3 Replies

2. Solaris

whole day commands executed by particular user

Hi all I want to know the commands executed a by particular user .. for the whole day on my machine. I have checked out with the commad $lastcomm <user> It is throwing an error called: .. /var/adm/pacct: No such file or directory Can u help me in this regard.. Thank U Naree (1 Reply)
Discussion started by: naree
1 Replies

3. UNIX for Dummies Questions & Answers

How does the internal commands are executed?

Hi all, I am new to unix OS. Commands(external commands) given by the user are examined by shell and later executed by kernel. Now I want to know how the internal(built in) commands are executed. Please clarify whether they are executed directly by shell or by kernel. Thanks in... (2 Replies)
Discussion started by: chaitra
2 Replies

4. Shell Programming and Scripting

Viewing the commands executed

Hi, I have executed a set of commands on the linux server and later rebooted the server. Is it possible to get the details of the commands I executed prior to the reboot? If yes please let me know how? Thanks. (1 Reply)
Discussion started by: yoursdavinder
1 Replies

5. UNIX for Dummies Questions & Answers

multiple commands to be executed at the same time

how to execute more than one command at the same time in unix .. (4 Replies)
Discussion started by: hemaa
4 Replies

6. Shell Programming and Scripting

To inform the executed commands

Dear friends, Whenever I do logout from a session initiated by ssh/su, I need to print a small report which says the login time, logout time, commands got executed.. How can it be done? I know when doing ssh, .profile file will get executed. Shall we do something with the help of it. (1 Reply)
Discussion started by: nagalenoj
1 Replies

7. UNIX for Dummies Questions & Answers

Commands will be executed using /usr/bin/sh

Hi, how to overcome this warning issue. code: #echo 'ls > /home/rxcprod/a.out' | at -q a now warning: commands will be executed using /usr/bin/sh job 1318943704.a at Tue Oct 18 09:15:04 2011 (4 Replies)
Discussion started by: tushar_spatil
4 Replies

8. UNIX for Dummies Questions & Answers

Clearing history of commands executed

Hi, I have cleared the commands by using >$HOME/.sh_history. But if i issue HISTORY it shows some reference numbers but not the commands executed. But i want to truncate those line numbers too. May i know how i can achieve this? Thanks (1 Reply)
Discussion started by: pandeesh
1 Replies

9. Shell Programming and Scripting

How to time stamp executed commands?

Hi guys, I am executing a pretty long ksh script and need to time stamp every command which runs inside. Unfortunatly 'echo date' is not the option here. May be someone knows another way or utility which can be used to log executed command and timestamp next to it. Thanks PS I work in ksh88 (4 Replies)
Discussion started by: aoussenko
4 Replies

10. HP-UX

Tracking what commands were executed after sudo to another user

All team members has sudo access to user "batch55". Need to track all the commands used by team members after sudo to "batch55". Using HP-UX and ksh shell in our environment. How can i acheive this? Thanks In Advance. (2 Replies)
Discussion started by: venkatababu
2 Replies
audisp(1M)																audisp(1M)

NAME
audisp - display the audit information as requested by the parameters SYNOPSIS
username] eventname] compartmentname] syscall] ttyid] start_time] stop_time] audit_trail... DESCRIPTION
analyzes and displays the audit information contained in the specified audit trails. All specified audit trails are merged into a single audit trail in chronological order. Although the entire audit trail is analyzed, the command allows you to limit the information displayed by specifying different options. This command is restricted to privileged users. If the audit information was collected in compatibility mode, each audit trail (audit_trail) is identified by a file name. If the audit information was collected in regular mode, the audit trail (audit_trail) is identified by a directory name. Only a privileged user can configure the auditing mode (compatibility or regular); see audsys(1M). The audit information that is collected in regular mode is identi- fied and displayed by directory names and not by file name since the file names may not represent complete trail information for analysis or display. Any unspecified option is interpreted as an unrestricted specification. For example, a missing option causes all users' audit information in the audit trail to be displayed as long as all other specified options are satisfied. As well, providing the option without the option causes all audit information beginning from start_time to the end of the trail to be displayed. If you invoke the command without any options, displays all recorded information from the start of the audit trail to the end. Specifying an option without its required parameter results in an error. For example, specifying without any eventname returns an error message. Options If this option is specified, does not terminate after it displays the last event. Instead, it waits for and displays audit events as they become avail- able. Specify the username (login name) for which to display the audit information. If no username is specified, displays audit information for all users in the audit file. Display audit information for the specified event category. eventname must be a valid event category (base event or event alias) that is defined in or (see audit.conf(4)). Another way to be certain an eventname is valid is to read the output of for a list of valid event category names and their associated system calls (see audevent(1M)). Display audit information on the specified compartment. See compartments(5). If no compartmentname is specified, displays audit information about all the compartments in the audit file. If compartments feature is disabled in the running configuration, this option is ignored. Display audit information about the specified system call. The syscall must be a valid system call name or system call alias name that is defined in or (see audit.conf(4)). Another way to be certain a syscall is valid is to read the output of for a list of valid syscall names (see audevent(1M)). Display only successful operations that were recorded in the audit trail. A user event that results in a failure is not displayed, even if username and eventname are specified. The and the options are mutually exclusive; do not specify both on the same command line. To display both successful and failed operations, omit both and options. Display only failed operations that are recorded in the audit trail. Display all operations that occurred on the specified terminal (ttyid) and were recorded in the audit trail. By default, operations on all terminals are displayed. Display all audited operations occurring since start_time, specified as mmddhhmm[yy] (month, day, hour, minute, year). If the year is specified and is greater than 70, it is interpreted as in the twentieth century. Otherwise, it is interpreted as in the twenty-first century. If no year is given, the current year is used. No operation in the audit trail occurring before the specified time is displayed. Display all audited operations occurring before stop_time, specified as mmddhhmm[yy] (month, day, hour, minute, year). If the year is specified and is greater than 70, it is interpreted as in the twentieth century. Otherwise, it is interpreted as in the twenty-first century. If no year is given, the current year is used. No operation in the audit trail occurring after the specified time is displayed. The year is displayed as a two digit number (with or as a four digit number (with The default is Note that start_time and stop_time must still be specified as two digit num- bers. AUTHOR
was developed by HP. FILES
file containing event mapping information file containing site-specific event mapping information SEE ALSO
audevent(1M), audit(4), audit.conf(4), audit(5), compartments(5). audisp(1M)
All times are GMT -4. The time now is 07:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy