44

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?

2
  • 4
    I also have ~/.cache/dconf and ~/.gvfs owned by root. Could this be from running nautilus as root?
    – Insperatus
    Commented Mar 19, 2015 at 0:14
  • 4
    ~/.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
    Commented Mar 19, 2015 at 1:39

2 Answers 2

53
+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.

3
  • 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
    Commented Aug 12, 2017 at 22:46
  • In the spirit of @SDsolar comment, thank you from July 2019. Commented Jul 19, 2019 at 13:21
  • Improper ~/.dbus ownership is a common root cause for the neverending graphical login failure, see here askubuntu.com/questions/223501/… . ~/.xsession-errors usually hints at that.
    – reim
    Commented Jan 4, 2022 at 0:58
11

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

sudo chown -R "$USER": .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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .