History to Another file [local user history , but root access]

Hi all,

My need is :

  1. To know who , when , which command used.
  2. Local user should not delete this information.
    [The thing is , here we have a number of employees working in root permission.!!! And we are not actually getting who is doing which command and all...]

I mean , with an example , i can say
i have a user user1

i need to give all the following permissions to user1, :
a. A specific directory other than his home directory.
b. To edit /etc/profile
c. And/Or any other specific files/dirs.

user1's history will be saved in ~/.bash_history
user1 will have -rw-------. permission to ~/.bash_history

So there is a chance that he may delete the file itself / delete the content.

And so , i am thinking to do like..
i will have another file somewhere , say , /var/.bash_hist_user1

so automatically , What are all the commands entering by user1 should come inside /var/.bash_hist_user1 also.

OR ELSE

What are all the commands entering by user1 will come in ~/.bash_history
But he cannot delete the file / content.

Is it possible ? :rolleyes:

Yep.

Check for:

1 Like

Thank you psshah..

Is the first link can only used for Solaris. ?

I use CentOS only.

All three were for Solaris.

Anyways for linux,