Disable environment settings

Kenny Lussier klussier at gmail.com
Tue Jun 3 15:16:43 EDT 2008


On Tue, Jun 3, 2008 at 1:38 PM, <VirginSnow at vfemail.net> wrote:

> > Date: Tue, 3 Jun 2008 12:36:08 -0400
> > From: "Kenny Lussier" <klussier at gmail.com>
> > Cc: GNHLUG <gnhlug-discuss at mail.gnhlug.org>
>
> > cover all of the odd cases that we seem to be running into. I like sudo.
> > Unfortunately, people get tired of typing it when they need to run 100+
> > commands as another user to diagnose a problem. The option that they have
>
> cat > /usr/local/bin/do-as-other-user.sh << "EOF"
> COMMANDS="ln df ls fdisk foo bar" # list your commands here
> for COMMAND in $COMMANDS; do
>  BIN=`which $COMMAND` && alias $COMMAND="sudo $BIN"
> done
> EOF
>
> then . /usr/loca/bin/do-as-other-user.sh
>
> Would that work?
>

If the commands were predictable, then that would work just fine.
Unfortunately, most of the time the users log in as themselves then su - to,
for example, the database user to do database work, or to go through the
logs, etc., or to the user that a particular (in house custom) app runs as
to test certain things. There is no way to predict what they are going to be
doing on any given day/hour/minute/second. I am tempted to tell them to deal
with it and just make them enter tickets multiple times, but that will
quickly come back to haunt me :-)

So far, the best that I have come up with is at the begining of the login
script, get the pts, and create a file named ptsX.tkt, then test 1) if the
file exists and 2) if it contains a valid ticket.  On the first login, the
file won't exist, so it will be created, and it won't contain a valid ticket
until the end of the script. On an `su -`, the file will exist with a valid
ticket, so the prompts will be skipped and the environment variable will be
set. I need to do some garbage collection to remove the temp files so that
there isn't and overlap, preferably at logout, or at the time the pts is
freed up.... Some sort of global script that is executed automatically on
logout/exit that is not under the users control (i.e. not .bash_logout).
Again, my wishes tend to exceed the bounds of reality, and what I have to
work with was never really meant to do this sort of thing :-)

C-Ya,
Kenny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20080603/69008995/attachment.html 


More information about the gnhlug-discuss mailing list