4

Though i tried many commands to overcome this warining but am unable to overcome them so help me to get rid of this warnings

root@radhika-M68MT-D3:~# sudo nautilus

(nautilus:2642): IBUS-WARNING **: The owner of /home/radhika/.config/ibus/bus is 
not root!Nautilus-Share-Message: Called "net usershare info" but it failed: 'net 
usershare' returned error 255: net usershare: cannot open usershare directory /var/lib
/samba/usershares. Error No such file or directory Please ask your system 
administrator to enable user sharing.
Sweety Mouni
  • 43
  • 1
  • 1
  • 4
  • What happens if you do `gksudo nautilus`? This is preferred for GUI applications. – Sparhawk Aug 13 '13 at 06:01
  • it is showing the above warining wen i use that command in terminal – Sweety Mouni Aug 13 '13 at 06:02
  • When you use `gksudo`? This shouldn't reference your personal home directory. (e.g. http://askubuntu.com/questions/11760/what-is-the-difference-between-gksudo-nautilus-and-sudo-nautilus ) – Sparhawk Aug 13 '13 at 06:02
  • but it is showing sam warining – Sweety Mouni Aug 13 '13 at 06:04
  • root@radhika-M68MT-D3:~# gksudo nautilus (nautilus:2950): IBUS-WARNING **: The owner of /home/radhika/.config/ibus/bus is not root! Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory Please ask your system administrator to enable user sharing. – Sweety Mouni Aug 13 '13 at 06:04

1 Answers1

5

Quick Answer

Use gksudo nautilus or sudo -H nautilus or sudo -i nautilus instead.

Explanation

You shouldn't use plain sudo to run graphical applications, because it makes root and your non-root user account try to use the same configuration files, which often causes root to own files that the non-root user needs to (but cannot) access.

Recent versions of Nautilus will actually recognize this problem and refuse to run, in order to prevent their per-user configuration from being broken on your non-root user account.

The solution to this problem is, when running graphical programs as root (especially Nautilus), use a method that avoids this problem. The methods that avoid this problem are the methods that make the program you're running look for and create configuration files in root's home directory (/root), rather than your own home directory (/home/ussername).

The Solutions, and Why They Work

The HOME environment variable is usually consulted to determine the home directory to be used. You want this to be set to /root. You don't do this directly; instead, run graphical applications in a way that does this for you automatically.

Traditionally, all Ubuntu systems had gksudo or (for Kubuntu) kdesudo installed, and you would use them instead of sudo when running graphical applications. That might work; I recommend you try replacing sudo with gksudo before you try anything else. Unfortunately, gksudo is not always installed on the newest versions of Ubuntu. You can, of course, install it (in the Software Center or with sudo apt-get update && sudo apt-get install gksu).

Also, please note that traditionally, on Ubuntu, gksu and gksudo did the same thing. But a recent bug sometimes makes gksu behave in a way that doesn't work right for an Ubuntu system. This is why I recommend gksudo, even though I have usually recommended gksu (which does "the right thing" on many different Unix-like systems, when properly configured).

But there are alternatives to gksudo. You can tell sudo to run a program as root and use root's home directory instead of yours:

sudo -H nautilus

If you don't have gksudo, I recommend sudo -H. However, you can also use:

sudo -i nautilus

sudo -i simulates a full root login (even if actual root logins are disabled), which sets many environment variables, including HOME, to their root-user values.

(After the command is run, and in other programs or other commands that are not started from the program you're running as root, the environment remains unchanged. You never have to "change it back.")

Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
  • ya it is accepting but i logged in as root administrator why it is not recogninsing as root admin then – Sweety Mouni Aug 13 '13 at 06:07
  • @Eliah Kagen It seems that `gksudo` still references the user's home directory, as per the comments above. – Sparhawk Aug 13 '13 at 06:07
  • @SweetyMouni What do you mean when you say "I logged in as root administrator"? – Eliah Kagan Aug 13 '13 at 06:08
  • i mean there is only one account in my system that is radhika and it is the administrator account. – Sweety Mouni Aug 13 '13 at 06:09
  • when i use ls /home command it is showing as radhika it mean it is the root account na... – Sweety Mouni Aug 13 '13 at 06:10
  • @SweetyMouni [Administrators can use `sudo` and other methods to perform actions as root, but administrators are not actually root.](http://askubuntu.com/questions/245201/how-to-not-become-a-root-user-are-administrators-root/245262#245262) `radhika` is not the root account, unless you have manually modified your configuration to make this the case (which is not recommended ...and not something anyone can do by accident, as it would involve manually editing numbers in a configuration file). To check if you are root, run `echo $UID $EUID`. Zeros mean `root`. Other numbers mean other users. – Eliah Kagan Aug 13 '13 at 06:16
  • 1
    @SweetyMouni You seem to have accepted this, so does `gksudo nautilus` *not* produce the same error message? – Sparhawk Aug 13 '13 at 06:18
  • ok ok it is showing 1000 1000 mean this is not root.k then actually my problem is in /opt/ folder am unable to paste a folder so to get rid of it am using this sudo nautilus command so how can i change it as root – Sweety Mouni Aug 13 '13 at 06:21
  • 1
    @Sparhawk it is not working for gksudo nautilus but it is working for sudo -H nautilus – Sweety Mouni Aug 13 '13 at 06:23
  • @SweetyMouni In that case, you can just use `sudo -H nautilus`. This should enable you to add files to `/opt`. – Eliah Kagan Aug 13 '13 at 06:23
  • @EliahKagan Any idea why it would work for `sudo -H` but not `gksudo`? – Sparhawk Aug 13 '13 at 06:25
  • actually yesterday for sudo nautilus command it worked properly but today it is not working but why this change occured? – Sweety Mouni Aug 13 '13 at 06:27
  • @SweetyMouni Configuration files in `.config/ibus` may have been created since `sudo nautilus` last worked; that might explain why it worked then by not now. As for why `gksudo nautilus` does *not* work, I recommend posting a separate question about that. – Eliah Kagan Aug 13 '13 at 06:32