Quote:
Originally Posted by
mohtashims
Yes, i m testing this out. once good with the scripts i will change the log location.
This is not the point Corona688 has raised: your script, when called from the login routine of a user, runs with the credentials of this user. To append the text the user enters to the log file the user has to be allowed to write to this file.
But because he is allowed to write the file he is also free to remove any content from the file - he could reduce it to zero length. So your whole mechanism is flawed from the beginning.
Since shell scripts cannot run as SUID (that is, run with the effective privileges of another user, not the one executing it) you will need to write a C- (or any other programming language you can compile to an object deck) program which takes the text and then writes it to a log file not writable by the user itself.
I hope this helps.
bakunin