PDA

View Full Version : file manager - super user mode ??



im_ka
5th February 2004, 05:45 PM
greetz!

i've installed fedora yesterday, and it`s by far the greatest distro i've tried (suse, mandrake, slack, knoppix).

however, i can't find i feature that i've greatly appreciated in other distros:

file manager - super user mode

is there smthg like that (using gnome)? cause it makes it a lot quicker to copy/move/delete files than doing it in terminal.

thx 4 any help!

mhelios
6th February 2004, 09:11 AM
There are at least a couple ways to do this. The first is a simple and non-permanent method of running a user program with root privileges. The second makes the privileges permanent and is used for all the standard programs that need to be run as root (such as all those in /sbin, /usr/sbin, etc.).

1) If you have set up your sudoers file and have a working sudo command (recommended), then simple issuing a `sudo <programname>` from a terminal will allow you to run the program with root privileges. Since you're looking for a file manager, you would use `sudo nautilus`, enter the root password and nautilus will opon up in /root with full access to all files/folders.

2) This method uses the program /usr/bin/consolehelper which is the little pop-up box you get when you you run any of the programs in the menu requiring root permissions (such as System Tools -> System Logs). It allows you to simply enter your root password into the box and the program launches as root. It is simply a GUI wrapper to the program /usr/bin/userhelper which is the program behind the scenes doing all the real work.
As an example, here's how you would add an entry for a "super-user" nautilus, the graphical shell for GNOME to require root's password and thus gain full access privileges:

[code:1]
# first copy /usr/bin/nautilus to /usr/sbin/nautilus
$sudo cp /usr/bin/nautilus /usr/sbin/nautilus
# now move /usr/bin/nautilus to an alternative location such as $HOME/bin
$mv /usr/bin/nautilus $HOME/bin

##NOTE: If you move it to $HOME/bin you can still run it with $`nautilus` if you add this location to your PATH. For example my .bashrc file contains:
"PATH=$HOME/bin:$PATH:/usr/local/j2re1.4.2/bin" (w/o quotes). [Adding $HOME/bin to the front of your PATH will be needed otherwise /usr/bin will be searched first and you'll just get a command not found error]##

# Now create a symlink from nautilus to consolehelper
$cd /usr/bin
$sudo ln -s consolehelper nautilus

# The PAM config files must be created for nautilus
$sudo gedit /etc/pam.d/nautilus
# Enter the following and save
------------CUT HERE-------------------------------------------
#%PAM-1.0
auth sufficient pam_rootok.so
auth sufficient pam_timestamp.so
auth required pam_stack.so service=system-auth
session required pam_permit.so
session optional pam_xauth.so
session optional pam_timestamp.so
account required pam_permit.so
-------------------------------------------------------------------

$sudo gedit /etc/security/console.apps/nautilus
# Enter the following and save
------------CUT HERE-------------------------------------------
USER=root
PROGRAM=/usr/sbin/nautilus
SESSION=true
-------------------------------------------------------------------
[/code:1]

Now, running nautilus from the command line or from the GNOME menu -> Home Folder will prompt for your root password.

One final thing you may wish to do is re-add a menu entry for a regular nautilus program. To do this you:
[code:1]
# Edit the menu entry for "Home Folder" to now specify it as the superuser # version
$sudo gedit /usr/share/applications/gnome-nautilus.desktop
-> Change the "Name" item to something like "Home Folder (Super User)" and save.
# Now create a new menu entry for the regular user version
$sudo gedit /usr/share/applications/gnome-nautilus-orig.desktop
# Enter the following and save
------------------CUT HERE------------------------------------------------------
[Desktop Entry]
Encoding=UTF-8
Name=Home Folder
Comment=View your home folder in the Nautilus file manager
Exec=/home/$USER/bin/nautilus
Icon=gnome-home.png
Terminal=false
Type=Application
Categories=Application;Core;X-Red-Hat-Base;
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=nautilus
X-GNOME-Bugzilla-Component=general
X-Gnome-Bugzilla-OtherBinaries=nautilus-adapter;nautilus-content-loser;nautilus-sidebar-loser;nautilus-text-view;nautilus-throbber;



X-Desktop-File-Install-Version=0.3
OnlyShowIn=GNOME;
--------------------------------------------------------------------------------------
[/code:1]
## NOTE: In "Exec", exchange $USER for your username

Now if everything went fine (and I hope it did!), you should now be able to select Menu-> Home Folder and receive the regular non-privileged nautilus window or Menu -> Home Folder (Super User) and be prompted for root's password to reach a nautilus window with full access permissions.

Well that's (finally) it. Feel free to add any corrections.

by mhelios (MH, 2004)

Ug
6th February 2004, 12:39 PM
I thought I ought to issue the standard super user warning:

Do NOT use super user for everything as this is a guaranteed way to fubar your system. And make sure you back everything up that you change when tinkering.

mhelios
7th February 2004, 02:05 AM
This is actually the safest way to grant these privileges to a program. As I mention at the top, I recommend people use sudo for all there tasks requiring root. Consolehelper works in much the same way. It uses the session management capabilities of PAM to temporarily grant elevated privileges to the program in question. Note, it's confined only to that GUI shell - not the whole desktop environment. Once the program is closed, the session ends and the regular user permissions are once again in place.

Of course, ug_the_caveman's advice should always be heeded - that is why the way these programs work minimise the potential for messing up any part of the system.

mhelios

Minaki
25th February 2006, 12:55 PM
You can use too a gksu tool. it's more simple. It's a tool like gksudo then the Ubuntu distribution use. You just type gksu before the command like : gksu nauthilus.

But I suggest to you do not use the save password possibilities, you will maybe forget that you have a root privilege.

You can donwload at at Dries repository http://dries.ulyssis.org/.

For me the PAM method it's a very good method for adminitrator in enterprise network or something like that and you must use it. But if you are on PC at home you don't to be more royalist then the queen.

Best regards

nishikant
31st March 2008, 12:18 PM
gksu or gksudo is not available for FEDORA. So fedora users can use "kdesu". you can also create a menu shortcut. In command box enter


kdesu "nautilus --no-desktop --browser"

http://forums.fedoraforum.org/attachment.php?attachmentid=15559&stc=1

and u r done..