Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: HOW do i..



[moved to zsh-users]

>
> ..do the following:
>
> 1. i want root to be the owner of users's history file.
> 2. everytime the user exits the system, i want his history file to be
> mailed to whatever e-mail address specified. how do i execute a command
> upon exiting? i always use TRAPEXIT, however, i can't make zsh to
> read/write with root permissions.
>



I suspect, you want

- get log of all user activity
- prevent user from modifying this log

This can't be done, sorry. To save history entries in a file, this file should
be user-writable. It does not matter, whom this file belongs to. History file
is written (if at all) after every command. It means, user can edit it at any
time and remove any entries. This applies to any logging.

The most you can do is to use fc command to write *current* entries (up to
HISTSIZE) to some file at logout. But, how can you prevent user from modifying
.logout, TRAPEXIT ot whatever?

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author