28

I have a folder ~/.dbus in my homefolder that is only read and writeable by root:

drwx------  3 root  root  4096 Feb 17 17:30 .
drwx------  2 root  root  4096 Feb 17 17:30 session-bus

Is this the correct setting? Or if not, how could that happen?

  • 3
    I also have ~/.cache/dconf and ~/.gvfs owned by root. Could this be from running nautilus as root? – Insperatus Mar 19 '15 at 0:14
  • 2
    ~/.cache/dconf and ~/.gvfs owned & in some cases created by root would be the result of running either sudo nautilus or sudo gedit. In 14.04 or newer these directories don't even exist anymore in a fresh install & aren't used. So stop using either of those 2 commands – doug Mar 19 '15 at 1:39
38
+50

The reason for these being created with root ownership in the first place is usually the way sudo preserves some user environment. ls: cannot access .gvfs: Permission denied

That folder .dbus and .cache with all it contents is supposed to be owned by the user whom the home directory belongs to. It is usually safe to delete either, it will be recreated next time you login (it is just a cache that would have gone obsolete eventually).

# be careful what you type when you use rm -rf!
sudo rm -rf ~/.dbus

Keep in mind that .gvfs behaves somewhat special since it's a mount point (check the output of mount to confirm). As long as you have network folders mounted, don't touch it.

  • Good info. I was getting stuck trying to copy all my home directory in the File Manager. So the colution for me was to simply tell it to open in terminal on the backup drive and use sudo cp -r ~/* . TNX from Aug 2017! – SDsolar Aug 12 '17 at 22:46
2

Alternatively you could just make yourself the owner of this folder recursively.

sudo chown -R username:username .dbus

I know the only reason many people know about this folder is because they backup their home directory and get errors from their backup software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.