Ubuntu – “~/.wine is not owned by you”, am I safe

malwareSecuritysudowine

So I was running about trying to install something in wine when I encountered the suggestion to use sudo to get administrator privileges. That's when I got the above message

~/.wine is not owned by you

Reading up I quickly realised why this message appears and that trying to sudo wine is A REALLY BAD IDEA.

So I didn't do anything further and don't intend to ever sudo wine again. My question is, because I received this block, am I safe? Or do I need to remove all of wine because I did?

Best Answer

  • Wine expects that $WINEPREFIX (which defaults to ~/.wine) be owned by you. When you run wine with sudo, ~/.wine is owned by you, but wine is running as root. Hence the error. Wine immediately quits when this happens, so you don't need to worry, no damage was done.

    You don't need to reset ownerships as in Zanna's answer (this particular run of wine didn't make any changes), but that's usually harmless.

    Note that Wine applications have as much access to the system as the user they run as, so running Wine as root, as you have realised, is dangerous.