Eric on 1 Sep 2007 13:28:30 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] shell script help...


Mag Gam wrote:
> I am in the process of writing a shell script to take history file (fc
> -l) and backup it up, while appending it.
> 
> My strategy is, once the user exits out of his shell, i will dump the
> history into a file by using a trap() with EXIT. The file will be
> appended by the username... (ie, username.history.date
> 
> My question is, if a user changes his shell from bash to ksh to tcsh, I
> am not able to get the output because I have my trap + exit to look at
> $SHELL.  Is there any way to disable a user to log into a different shell?


My understanding is that a shell script is not a sure thing for this kind of
task and the other comments seem to support this.  Another work-around would be
for someone to invoke vi or emacs, place evil and/or unauthorized commands in a
shell script and then invoke that script.  If they named it "bc" (for example)
and set their path (or alias the command) accordingly then the history of their
shell commands would not show you what they were doing.

If you have the time and need 100% assurance then I'd edit the source of all the
available shells on the machine in question to add the functionality you need.

Eric
-- 
#  Eric Lucas
#
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug