Tom H tomh0665 at
Sat Jun 14 06:49:24 UTC 2014

On Mon, Jun 9, 2014 at 2:58 PM, Nils Kassube <kassube at> wrote:
> Tom H wrote:
>> On Mon, Jun 9, 2014 at 9:48 AM, Nils Kassube <kassube at> wrote:
>>> With "sudo su" I have $HOME set
>>> to "/root" while it is still "/home/$USER" for "sudo -s". That is
>>> an important difference if I then start an application that
>>> modifies configuration files and changes their permissions in
>>> $HOME. It may therefore prevent further access to those files by
>>> the original user and the application run as normal user may no
>>> longer work.
>> I'd never noticed that Ubuntu HOME isn't set to the target user's
>> HOME.
>> The upstream default (that's not changed in RHEL and Fedora for
>> example, and perhaps not in other distributions) is for HOME to be
>> reset to the target user's HOME.
>> It turns out that there's a patch in Ubuntu (it might be inherited
>> from Debian, I haven't checked), "keep_home_by_default", to keep HOME.
>> I wonder what the rationale is/was.
> Good question. IMHO it isn't useful, but what do I know. I don't think
> it comes from Debian. I just checked the "sudo -s" behaviour on a
> Raspberry Pi running Raspbian which is also derived from Debian. But
> there $HOME is always set to "/root".

It's be useful to satisfying my curiosity to know why Ubuntu's
deviating from upstream and other distros. :)

I'll have to do some googling when I have a chance...

More information about the ubuntu-users mailing list