Re: su for dummies



> Obiously we need a "become root" dialog!

Can't you do this with a simple shell or Perl script?
That's the beauty of being able to run arbitrary commands from the panel
and menus.

On one machine I ran, I had a 'guest' account for visitors to use when
they were at my house.  Many of them were friends I knew from IRC, so I
added a little launcher button to fire up an IRC client in an Xterm.

However, it's kind of annoying to log onto the channel as "guest" and
then re-"/nick" yourself to the name you use all the time.

So, with Tcl/Tk, I created a little prompt window that popped up and
asked for the user's IRC handle.  That was sent directly to the IRC
command.

It went something like this (this is off the top of my head :) )

  xterm -e irc -c #chan `/usr/bin/getname "IRC Handle?"` irc.server.net

or something.  I think I set the xterm's (probably gnome-terminal now
that I think of it) background and text colors to something different
than the default (white on black), so that the IRC window was very obvious.

You could do the same to create a root xterm.  You could have a
"login-as-root" shell script:

  #!/bin/sh

  echo -n "Please enter root's "
  su -


Then add a launcher to run this script:

  gnome-terminal -t"Root Prompt!!!" --background="dark red" \
                 --foreground=white -x /usr/local/bin/login-as-root.sh


Think that's suitable?

-bill!




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