How to enforce users not to modify their command history.


 
Thread Tools Search this Thread
Operating Systems HP-UX How to enforce users not to modify their command history.
# 1  
Old 06-23-2008
How to enforce users not to modify their command history.

As a system administrator. sometimes we see the users are trying some commands dangerous for the system health and remove them from their individual coomand history file.

How it is possible to enforce that the normal usres will will not be able to modify the history.

Thanks in advance.
Partha
# 2  
Old 06-23-2008
If they know how to use history files youre doomed...
Alternatives?
Well
1) audit on the those commands...
2) remove execute privilege for them on those commands and install and use sudo so they have to use sudo to execute those commands (you will have to configure properly the sudoers file...) for sudo will log all the sudo activity AND the user cannot remove sudo logs...

Last edited by vbe; 06-27-2008 at 05:45 AM.. Reason: spelling...
# 3  
Old 06-23-2008
What type of dangerous commands are the users capable of executing ?

Most dangerous commands are limited to root, other than rm.

If these users have access to files they should not then fix your security instead of trying to cover it up.

Turn off the history file option ? set HISTFILE=/dev/null or something else the user does not have permission to.
# 4  
Old 06-23-2008
We have the following in our /etc/profile:

Code:
HISTFILE=/var/log/hist/$USER`date +%Y%m%d%H%M%S`.hist
HISTSIZE=100000

That keeps a nice, timestamped record of everything. Then you can copy that off to another location every now-and-again for posterity's sake.

Of course, this only works for people who don't know where to look to find such things.
# 5  
Old 06-27-2008
What do they do to the history?
>.sh_history ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How-to enforce check on getopts command

here is my script that expects the user to run it like ./best.sh -f /tmp/log.txt more best.sh #!/bin/bash while getopts ":f:" opt; do case $opt in f) file_in="$OPTARG" ;; \?) echo "Invalid option -$OPTARG" >&2 ;; esac done uname -a SunOS mymac 5.11 11.2 sun4v... (15 Replies)
Discussion started by: mohtashims
15 Replies

2. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code: archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (0 Replies)
Discussion started by: rehantayyab82
0 Replies

3. Shell Programming and Scripting

History of all the users in single file with command , date . time , ip and user

HTML Code archive_history() { HISTORYOLD=${HISTFILE}.archive CURTIME=`date` CURTTY=`tty` IP=$(echo $SSH_CLIENT | awk '{print $1}') if ; then echo "#-${HOSTNAME}-- ${CURBASHDATE} - ${CURTIME} ($CURTTY) ${USER} ${IP}----" >> $HISTORYOLD history... (2 Replies)
Discussion started by: rehantayyab82
2 Replies

4. Shell Programming and Scripting

Tracking users through history command

Hi folks, I have the basic query that there are 3 unix boxes having their individual access now in my team there are 4 members who are using the same credentials to access those 3 boxes through putty ssh from their windows desktop , now if i want to check which 4 members have executed the... (1 Reply)
Discussion started by: punpun66
1 Replies

5. Shell Programming and Scripting

How to get users history as mail..

Hi all, Thanks in Advance, i want to view my users commands, what commands they are using in their terminal like that, how to automate this history process daily. (6 Replies)
Discussion started by: anishkumarv
6 Replies

6. UNIX for Dummies Questions & Answers

The history command: See other users command history

Can anyone tell this: If two users are logged into the same server from different locations. Is there a way to see the history command of the other user? I tried the history command, but it is showing me only the commands I used. Thanks in advance for your help. Iamnew2solaris (1 Reply)
Discussion started by: iamnew2solaris
1 Replies

7. Solaris

How to enforce all users to change their password

Hi All, How to enforce all users to change their password when they try to login. I am having Solaris 9 and 10. Even it would be much better if anyone can say to enforce all users to change their password next morning they login. Thanks in advance, Deepak (3 Replies)
Discussion started by: naw_deepak
3 Replies

8. UNIX for Dummies Questions & Answers

Need to sort/change modify 2300 users ...

Ok, so here's my project I've been given and I know very little about this. I have an AIX unix box that has over 2300 local users. Any user with 4 or less characters in the username does not get changed. Any user with 5 or more needs to have the attribute shell=/bin/ksh changed to... (1 Reply)
Discussion started by: tresani
1 Replies

9. UNIX for Advanced & Expert Users

tcsh history for several users

Hi all! I have a nice challange for you today :) I have several users that use "tcsh" the problem is that they all have the same "home_dir" (application reasons...), now... as far as i know (correct me if i'm wrong) every user have an history file in his "home_dir" that calls ".sh_history" or... (0 Replies)
Discussion started by: eliraza6
0 Replies

10. Shell Programming and Scripting

Modify users password via script?

Ok, first off, I'm working on a Vmware ESX server, which I guess is loosely based off of Red Hat 9. But I'm brand new to it (today), so be nice. I'm trying to write a useradd script that will create some users, generate a password, and set their password to this newly generated password. ... (2 Replies)
Discussion started by: paqman
2 Replies
Login or Register to Ask a Question