Bugzilla – Bug 220511
Unable to run nautilus as a root user.
Last modified: 2008-05-22 18:18:32 UTC
If I try an launch nautilus as a root user, it will not launch. I have tried going into a terminal, su to root, and then typing in nautilus. Nothing happens. I don't even get any messages in the terminal. I have also tried typing gnomesu nautilus. Same result. I do this because often times I need to edit or attach log files that are in a restricted area. Like /var/log.
I don't think this has ever worked, and if it did, it won't do what you expect. Under the circumstances you describe, Nautilus is designed to signal the existing process, telling it to open another window. The fact that this doesn't work if you're root telling the owner of the current session's Nautilus to open another window, may be considered a bug. But even if this was fixed, the new window will not have root privileges. Another possible fix would be to launch a -nodesktop Nautilus window in a separate process, as root. This means root will get a gconfd, etc. The window may look different since root's preferences will be used, not the user's. However, I consider the latter a new feature and not a bug fix. Note that this is complicated by the fact that "root" can be any other user, in theory.
I don't understand this last comment at all. This has always worked and it did open up with root privileges and therefore is a bug.
Okay. If it used to work, I'm in the wrong here. I still wonder if this is something we should support doing, though. Ideally there would be some sort of privilege escalation support in Nautilus proper (similar to authenticating to remote shares).
It runs it SLE 10 and it works in 10.2 if you do 'su -' but not 'su' or 'gnomesu'
(In reply to comment #4) > It runs it SLE 10 and it works in 10.2 if you do 'su -' but not 'su' or > 'gnomesu' It works on SLE without having to do the su -
same problem here as well. After upgrading to openSUSE 10.2, I realized I can not launch nautilus as root anymore. So I did some research and experiments and found that $sudo -i $DISPLAY=:0 nautilus works. Also,gdmsetup needs the same procedure too. $sudo -i $gdmsetup
Could be a duplicate of 229209
Toru: Is the "DISPLAY=:0" before "nautilus" really necessary? Why isn't it necessary before "gdmsetup"? Can you issue the command "set >broken-session.txt" after su'ing (when nautilus will _not_ work) and "set >working-session.txt" after sudo -i'ing (when it _will_ work), and attach the diff between those two files (using "diff -u broken-session.txt working-session.txt >session-diff.txt") to this bug?
Sorry! I'm late. Opps. I needed the "DISPLAY=:0" before "gdmsetup". My bad. $sudo -i $gdmsetup gives me (gdmsetup:5106): Gtk-WARNING **: cannot open display: >Can you issue the command "set >broken-session.txt" .. snip No. It seems cursor is just blinking. I just updated the other PC from 10.1 to 10.2. Yap, I'm no longer be able to launch nautilus as root (unless I use the trick above).
The bug is caused by dbus package. After I debugged the dbus code, I found that nautilus is hung at the _dbus_mutex_lock function( dbus-1.0.0/dbus/dbus-thread.c ). It seems that SU command do not make the dbus-session service to work well, we need to use `dbus-launch --auto-syntax` command to start dbus-session service. So my suggestion is: take three steps: 1. $su 2. $dbus-launch --auto-syntax 3. $nautilus
Removing needinfo from Toru as per comment#9
Joe reports this works fine with su and su - in 10.3.