${LOGNAME} vs. ${USER}

Johnny Rosenberg gurus.knugum at gmail.com
Fri Jul 31 11:45:43 UTC 2015


2015-07-30 15:41 GMT+02:00  <silver.bullet at zoho.com>:
> On Thu, 30 Jul 2015 04:19:44 -0700, Tom H wrote:
>>On Thu, Jul 30, 2015 at 3:23 AM,  <silver.bullet at zoho.com> wrote:
>>> I'm booted to Arch Linux at the moment, but it shouldn't differ
>>> What you need for your usage, depends on what you want to achieve.
>>>
>>> Take a look at the differences, especial how it differs after running
>>> sudo or su.
>>>
>>> $ echo $LOGNAME $USER $(id -un) $EUID $(id -u)
>>> rocketmouse rocketmouse rocketmouse 1000 1000
>>>
>>> $ sudo -i
>>> # echo $LOGNAME $USER $(id -un) $EUID $(id -u)
>>> root root root 0 0
>>>
>>> $ su
>>> # echo $LOGNAME $USER $(id -un) $EUID $(id -u)
>>> rocketmouse rocketmouse root 0 0
>>
>>Sure, using su and sudo changes things but that's not what the OP was
>>asking about - unless I misunderstood the question.
>
> Btw. just setting up a root account for Ubuntu by passwd root, Ubuntu does
> behave different than my Arch.
>
> [weremouse at moonstudio ~]$ echo $LOGNAME $USER $(id -un) $EUID $(id -u)
> weremouse weremouse weremouse 1000 1000
>
> [weremouse at moonstudio ~]$ sudo -i
> [root at moonstudio ~]# echo $LOGNAME $USER $(id -un) $EUID $(id -u)
> root root root 0 0
>
> [weremouse at moonstudio ~]$ su
> [root at moonstudio weremouse]# echo $LOGNAME $USER $(id -un) $EUID $(id -u)
> root root root 0 0

I couldn't even test the last one, since I don't have a root password
configured.
Anyway, thank you all for replying!


Regards

Johnny Rosenberg
ジョニー・ローゼンバーグ


>
> Regards,
> Ralf
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users




More information about the ubuntu-users mailing list