Re: Launching Nautilus as su?



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


-- 
Regards Bill




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