Re: Launching Nautilus as su?



On Sat, 2007-07-21 at 22:33 +0100, Simos Xenitellis wrote:
Στις 21-07-2007, ημέρα Σαβ, και ώρα 13:32 -0400, ο/η William Case
έγραψε:
Hi Giorgos;

On Sat, 2007-07-21 at 18:17 +0300, Giorgos wrote:
Hi! :-)

THANKS to Adam and Tim for their help! ;-)

I didn't made it! I tried the suggested options among some similar ones (eg.
gk, gnomesu etc.).

All of them are failing after su pwd confirmation. I think maybe is a
general mistake of opensuse (which I'm using) or a specific one for my
hardware configuration.

I'm thinking to try a different distribution, just to be sure.

I have a script that works for me. I am using Fedora 7 and it worked on
FC6. I can't see how opensuse would make a difference. All the
commands are at the bash and Gnome level.

#! /bin/bash
# Open nautilus as root
# file name: RootBrowse
# -K starts new timestamp for sudo

sudo -K
zenity --entry \
--title="Browse files as root" \
--text="Enter your user _password:" \
--entry-text "" \
--hide-text |sudo -S nautilus --no-desktop --browser \
1> /dev/null 2> /dev/null

if [ "$?" != 0 ]; then
zenity --error --text="Sorry, wrong password"
exit 1
fi

# End

N.B. Be sure to change sudoers default, as root, so that "Defaults
requiretty" is commented out otherwise script fails trying to give you a
new tty. See example below.

# Defaults specification
#
# Disable "ssh hostname sudo <cmd>", because it will show the password
in clear.
# You have to run "ssh -t hostname sudo <cmd>".
# "Ignore above comments for local machine."

# Defaults requiretty


Doesn't OpenSUSE have "gksudo" ("gksu")?
It come by default with Ubuntu.

If this is a useful feature to have by default in GNOME, then it would
be good to explore adaptations to gksudo. For example, to differentiate
between normal nautilus windows and "gksudo" windows, it would be nice
to have the window theme change, become a big goldish like the location
bar in Firefox for https websites.

You can visit http://bugzilla.gnome.org/ and request such features!

You are probably right.

However, Fedora does not have gksudo and gksu. In fact, I and others
have put in a request for it. In the meantime, my above script works.
My suggestion to Giorgos is to get it working, on his machine (fewer new
variables); then change the format to whatever works for him or whatever
he has available. Of course, if he doesn't have zenity then he will
have to setup the script with gksudo (gksu). Getting the sudo (su -)
commands to work properly is the primary challenge.

I started by calling the browser for root on the command line; added
zenity (gksudo, gksu) and called them as a script; did some tweaking;
then loaded the script name into a launcher command line. Now I am one
click and a password away from browsing as root.

In fact, I have a very similar script to call emacs (but any text editor
will do) as root starting at the '/' directory. Security is looser but
I no longer have permission annoyances (on a single user machine) for
just about anything I want to do.

--
Regards Bill

_______________________________________________
gnome-list mailing list
gnome-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gnome-list


Relevant Pages

  • Re: sudo not log command
    ... Sudothe script will still log the commands every min/two and i ... If I try setting chown to root for the script then setting suid on the ... Yes, in Linux, scripting languages don't recognize the setuid bit on script ...
    (comp.os.linux.misc)
  • Re: [opensuse] Quick Bash Q - How to test for root when under su
    ... E_NOTROOT=67 # Non-root exit error. ... In a script, I need to test that the user is either root or has su'ed ... For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx ...
    (SuSE)
  • Re: root privileges from cgi script?
    ... >>I am trying to find a way to run certain commands from a cgi script, ... >>I know suex can't be used because ROOT is specifically not allowed. ... >next is a secondary script that does all the usual start-up stuff, ... >the start-up script processing, you can eliminate the 1st part. ...
    (comp.unix.shell)
  • Re: Coupla questions
    ... > root and execute these commands even if I"m logged in as a regular ... create a script to do what you want when you are root. ... make sure you set the eXecute bit on the script: ...
    (alt.os.linux.suse)
  • IBM Informix Web DataBlade: Local root by design
    ... IBM Informix Web DataBlade: Local root by design ... Impact: Any user who can: 1) Save a Perl script anywhere on the server's ... admin right on any database can do it by loading the WDB module into ...
    (Bugtraq)