Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Well, Jim, I'm not much of an actor either.


computers / alt.os.linux.mageia / Re: X11-app after su - leads to DISPLAY error

SubjectAuthor
* Re: X11-app after su - leads to DISPLAY errorMarkus Robert Kessler
+* Re: X11-app after su - leads to DISPLAY errorThe Natural Philosopher
|`- Re: X11-app after su - leads to DISPLAY errorMarkus Robert Kessler
+- Re: X11-app after su - leads to DISPLAY errorAhem A Rivet's Shot
`* SOLVED - Re: X11-app after su - leads to DISPLAY errorMarkus Robert Kessler
 `- Re: SOLVED - Re: X11-app after su - leads to DISPLAY errorGrant Taylor

1
Re: X11-app after su - leads to DISPLAY error

<ul1khu$2613o$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5879&group=alt.os.linux.mageia#5879

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no_reply@dipl-ing-kessler.de (Markus Robert Kessler)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 11:54:38 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 81
Message-ID: <ul1khu$2613o$1@dont-email.me>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 9 Dec 2023 11:54:38 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6551ccb9080275f56e1ab555935572bb";
logging-data="2294904"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+mnF34zUTw/ry4zPw+AMmx"
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:IBrE3bOTxNETsIc0hfaklKBeFaM=
 by: Markus Robert Kessle - Sat, 9 Dec 2023 11:54 UTC

On 9 Dec 2023 04:37:09 GMT Robert Riches wrote:

> On 2023-12-08, Markus Robert Kessler <no_reply@dipl-ing-kessler.de>
> wrote:
>> Hello everyone,
>>
>> I'm just trying to switch the current user and then invoke some X11
>> application, but this does not work.
>>
>> On Redhat-based machines this never was a problem and I need this means
>> to keep my axxounts separate from each other for security reasons.
>> E.g., I do a
>>
>> 'su - bank'
>> and after loggin in I can invoke 'chromium-browser
>> https://pathtoonlinebanking'
>>
>> Now I see, that Debian-based Raspbian OS and Ubuntu (23.10) behave very
>> similar, it looks like this:
>>
>> $ su - test1 Passwort:
>>
>> $ firefox Error: no DISPLAY environment variable specified
>>
>> $ DISPLAY=':0.0' firefox Authorization required, but no authorization
>> protocol specified
>>
>> On Raspbian and on Ubuntu the same lets me assume that it was not me to
>> misconfigure something.
>>
>> Can this be fixed easily? - Thanks!
>>
>> Best regards,
>>
>> Markus
>
> It sounds like you're running into the XAUTH system.
>
> Normally, in the home directory of the user who's running X stuff there
> is a file called ".Xauthority", and environment variable XAUTHORITY
> holds the full, absolute path to that file.
>
> In order for user B to run X clients/apps when user A is the one who
> started the X server, user B must set environment variable XAUTHORITY to
> a file which user B has permission to read and which has the same
> contents as user A's ~/.Xauthority.
>
> How you get that file and environment variable set depends on your use
> case. I run my web browsers, gimp, and a few other programs as a
> different user for security and a few other reasons. I have wrapper
> scripts that do the file copying,
> environment variable setting, and environment variable preservation
> across sudo and/or su. For the way I do all that,
> user B's only reason for existence is to run browsers and such for user
> A, and it's important that user A have write permission to user B's home
> directory by means of the g+w permission bit.

Hi,

maybe there's a way around wrapper scripts?
I am wondering, why on Redhat-based systems like Mageia there is no need
for that, instead all this is done in background.

What I found out is, that when switching 'su - newaccount', then

- a file ~/.xauth* (e.g.: .xauthOa9EpX) is automatically created
(by su? by pam?)
- and when either starting x-app like xclock, so this works, or
- deleting this .xauth* and starting x-app, then above error occurs

This looks like su does all this "wrapping" automatically, as long as it
is confugured adequately. Maybe also systemd plays some role here.

Does anyone have more details here?
I am asking, because life would be easier, if this runs automaically :-)

Thanks!

Best regards,

Markus

Re: X11-app after su - leads to DISPLAY error

<ul1ldv$26m3a$3@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5880&group=alt.os.linux.mageia#5880

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 12:09:35 +0000
Organization: A little, after lunch
Lines: 17
Message-ID: <ul1ldv$26m3a$3@dont-email.me>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet> <ul1khu$2613o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 9 Dec 2023 12:09:35 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="182595f5a88d558df4c14c53a08dbe07";
logging-data="2316394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rMo23xCfnzQu8J0MVRd7S19KaQpZ9eMk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:RMYXpfUROJzMh3Obpr/F2Up6m3I=
Content-Language: en-GB
In-Reply-To: <ul1khu$2613o$1@dont-email.me>
 by: The Natural Philosop - Sat, 9 Dec 2023 12:09 UTC

On 09/12/2023 11:54, Markus Robert Kessler wrote:
> What I found out is, that when switching 'su - newaccount', then
>
> - a file ~/.xauth* (e.g.: .xauthOa9EpX) is automatically created
> (by su? by pam?)
> - and when either starting x-app like xclock, so this works, or
> - deleting this .xauth* and starting x-app, then above error occurs

This suggests that the original problem may have been su'ing to a user
with no home directory, or one that the user has no permissions for, so
this file cannot be created.
--
There is nothing a fleet of dispatchable nuclear power plants cannot do
that cannot be done worse and more expensively and with higher carbon
emissions and more adverse environmental impact by adding intermittent
renewable energy.

Re: X11-app after su - leads to DISPLAY error

<20231209121714.a51c8aa6b03b84f877c818ec@eircom.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5881&group=alt.os.linux.mageia#5881

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: steveo@eircom.net (Ahem A Rivet's Shot)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 12:17:14 +0000
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20231209121714.a51c8aa6b03b84f877c818ec@eircom.net>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet>
<ul1khu$2613o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="93465969343298764088377663fe6e28";
logging-data="2325620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JTjwIHJKzzu5DFaLRMeMaPEQtWV6zC34="
Cancel-Lock: sha1:gwoE2AzGZixzjEhvir1Up/poJ9Y=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1)
X-Clacks-Overhead: "GNU Terry Pratchett"
 by: Ahem A Rivet's - Sat, 9 Dec 2023 12:17 UTC

On Sat, 9 Dec 2023 11:54:38 -0000 (UTC)
Markus Robert Kessler <no_reply@dipl-ing-kessler.de> wrote:

> What I found out is, that when switching 'su - newaccount', then
>
> - a file ~/.xauth* (e.g.: .xauthOa9EpX) is automatically created
> (by su? by pam?)

Probably with this:

https://www.man7.org/linux/man-pages/man8/pam_xauth.8.html

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

Re: X11-app after su - leads to DISPLAY error

<ul1t00$2613o$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5883&group=alt.os.linux.mageia#5883

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no_reply@dipl-ing-kessler.de (Markus Robert Kessler)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 14:18:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ul1t00$2613o$2@dont-email.me>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet> <ul1khu$2613o$1@dont-email.me>
<ul1ldv$26m3a$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 9 Dec 2023 14:18:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6551ccb9080275f56e1ab555935572bb";
logging-data="2294904"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+J4uz42piZPaws8Gabcj+f"
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:XpCZFWAMtIC9R1wmQivrdj2LWT4=
 by: Markus Robert Kessle - Sat, 9 Dec 2023 14:18 UTC

On Sat, 9 Dec 2023 12:09:35 +0000 The Natural Philosopher wrote:

> On 09/12/2023 11:54, Markus Robert Kessler wrote:
>> What I found out is, that when switching 'su - newaccount', then
>>
>> - a file ~/.xauth* (e.g.: .xauthOa9EpX) is automatically created
>> (by su? by pam?)
>> - and when either starting x-app like xclock, so this works, or -
>> deleting this .xauth* and starting x-app, then above error occurs
>
> This suggests that the original problem may have been su'ing to a user
> with no home directory, or one that the user has no permissions for, so
> this file cannot be created.

Hi, good point, indeed, but on Mageia, where this works, I can switch
freely via su - test... betweeen test* accounts. Directory /home/ lists
like

drwx------ 9 test test 4,0K Dez 9 12:56 test/
drwx------ 2 test1 test1 4,0K Dez 7 16:46 test1/
drwx------ 2 test2 test2 4,0K Nov 4 20:10 test2/
drwx------ 10 test3 test3 4,0K Dez 9 11:24 test3/
drwx------ 2 test4 test4 4,0K Nov 21 14:45 test4/

So, the root cause may be located somewhere else.

BR,

Markus

SOLVED - Re: X11-app after su - leads to DISPLAY error

<ul2lvs$2b7oe$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5889&group=alt.os.linux.mageia#5889

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no_reply@dipl-ing-kessler.de (Markus Robert Kessler)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: SOLVED - Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 21:25:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 121
Message-ID: <ul2lvs$2b7oe$1@dont-email.me>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet> <ul1khu$2613o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 9 Dec 2023 21:25:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="6551ccb9080275f56e1ab555935572bb";
logging-data="2465550"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PBiBNJppBUxUxS+LxbSUc"
User-Agent: Pan/0.149 (Bellevue; 4c157ba git@gitlab.gnome.org:GNOME/pan.git)
Cancel-Lock: sha1:8awhUwVUF7hlPFOGXzJk+8OizS4=
 by: Markus Robert Kessle - Sat, 9 Dec 2023 21:25 UTC

Hi everyone,

I have suspected pam authentication already, and in the meantime I
compared Mageia and Raspbian more deeply regarding the entries in /etc/
pam.d.

I found out, that adding this line

session optional pam_xauth.so

to the front of /etc/pam.d/su

solves this issue. I've also tested this on Ubuntu successfully.

Now, after su - newuser, invoking an app for X11, like xclock, makes this
window open and working.

Finally, big thanks to all of you for this wonderful and highly
interesting discussion!

Nevertheless, it turned out to be a good idea to always handle X / desktop
sessions with care.

Thanks again,
best regards,

Markus

On Sat, 9 Dec 2023 11:54:38 -0000 (UTC) Markus Robert Kessler wrote:

> On 9 Dec 2023 04:37:09 GMT Robert Riches wrote:
>
>> On 2023-12-08, Markus Robert Kessler <no_reply@dipl-ing-kessler.de>
>> wrote:
>>> Hello everyone,
>>>
>>> I'm just trying to switch the current user and then invoke some X11
>>> application, but this does not work.
>>>
>>> On Redhat-based machines this never was a problem and I need this
>>> means to keep my axxounts separate from each other for security
>>> reasons. E.g., I do a
>>>
>>> 'su - bank'
>>> and after loggin in I can invoke 'chromium-browser
>>> https://pathtoonlinebanking'
>>>
>>> Now I see, that Debian-based Raspbian OS and Ubuntu (23.10) behave
>>> very similar, it looks like this:
>>>
>>> $ su - test1 Passwort:
>>>
>>> $ firefox Error: no DISPLAY environment variable specified
>>>
>>> $ DISPLAY=':0.0' firefox Authorization required, but no authorization
>>> protocol specified
>>>
>>> On Raspbian and on Ubuntu the same lets me assume that it was not me
>>> to misconfigure something.
>>>
>>> Can this be fixed easily? - Thanks!
>>>
>>> Best regards,
>>>
>>> Markus
>>
>> It sounds like you're running into the XAUTH system.
>>
>> Normally, in the home directory of the user who's running X stuff there
>> is a file called ".Xauthority", and environment variable XAUTHORITY
>> holds the full, absolute path to that file.
>>
>> In order for user B to run X clients/apps when user A is the one who
>> started the X server, user B must set environment variable XAUTHORITY
>> to a file which user B has permission to read and which has the same
>> contents as user A's ~/.Xauthority.
>>
>> How you get that file and environment variable set depends on your use
>> case. I run my web browsers, gimp, and a few other programs as a
>> different user for security and a few other reasons. I have wrapper
>> scripts that do the file copying,
>> environment variable setting, and environment variable preservation
>> across sudo and/or su. For the way I do all that,
>> user B's only reason for existence is to run browsers and such for user
>> A, and it's important that user A have write permission to user B's
>> home directory by means of the g+w permission bit.
>
> Hi,
>
> maybe there's a way around wrapper scripts?
> I am wondering, why on Redhat-based systems like Mageia there is no need
> for that, instead all this is done in background.
>
> What I found out is, that when switching 'su - newaccount', then
>
> - a file ~/.xauth* (e.g.: .xauthOa9EpX) is automatically created
> (by su? by pam?)
> - and when either starting x-app like xclock, so this works, or -
> deleting this .xauth* and starting x-app, then above error occurs
>
> This looks like su does all this "wrapping" automatically, as long as it
> is confugured adequately. Maybe also systemd plays some role here.
>
> Does anyone have more details here?
> I am asking, because life would be easier, if this runs automaically :-)
>
> Thanks!
>
> Best regards,
>
> Markus

--
Please reply to group only.
For private email please use http://www.dipl-ing-kessler.de/email.htm

Re: SOLVED - Re: X11-app after su - leads to DISPLAY error

<ul2n48$pv2$3@tncsrv09.home.tnetconsulting.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5892&group=alt.os.linux.mageia#5892

  copy link   Newsgroups: alt.os.linux.ubuntu comp.sys.raspberry-pi alt.os.linux.mageia
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!tncsrv06.tnetconsulting.net!tncsrv09.home.tnetconsulting.net!.POSTED.198.18.1.140!not-for-mail
From: gtaylor@tnetconsulting.net (Grant Taylor)
Newsgroups: alt.os.linux.ubuntu,comp.sys.raspberry-pi,alt.os.linux.mageia
Subject: Re: SOLVED - Re: X11-app after su - leads to DISPLAY error
Date: Sat, 9 Dec 2023 15:44:40 -0600
Organization: TNet Consulting
Message-ID: <ul2n48$pv2$3@tncsrv09.home.tnetconsulting.net>
References: <ukvrc6$1rt71$1@dont-email.me>
<slrnun7rnl.181.spamtrap42@one.localnet> <ul1khu$2613o$1@dont-email.me>
<ul2lvs$2b7oe$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 9 Dec 2023 21:44:40 -0000 (UTC)
Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="198.18.1.140";
logging-data="26594"; mail-complaints-to="newsmaster@tnetconsulting.net"
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <ul2lvs$2b7oe$1@dont-email.me>
 by: Grant Taylor - Sat, 9 Dec 2023 21:44 UTC

On 12/9/23 15:25, Markus Robert Kessler wrote:
> Hi everyone,

Hi,

> I have suspected pam authentication already, and in the meantime I
> compared Mageia and Raspbian more deeply regarding the entries in /etc/
> pam.d.

Aside: I wouldn't call this "authentication" in this context. PAM has
grown to do more things than just "authentication". The very fact that
you are using the "session" module (?) supports that this isn't an
authentication feature.

PAM is a very good place to do a lot of things to help streamline things
related to client logins.

> I found out, that adding this line
>
> session optional pam_xauth.so
>
> to the front of /etc/pam.d/su

N.B. My understanding is that the order of lines in PAM is important.
-- You are probably safe following another distro as a sample. But
don't sort the lines or anything like that.

> solves this issue. I've also tested this on Ubuntu successfully.

Nice work.

> Now, after su - newuser, invoking an app for X11, like xclock, makes this
> window open and working.

:-D

> Finally, big thanks to all of you for this wonderful and highly
> interesting discussion!

:-)

> Nevertheless, it turned out to be a good idea to always handle X / desktop
> sessions with care.

Absolutely!

I think it's even better to have some idea that there is complexity
behind it and that there might be more to look up if / when you have
need to tilt at the X11 shaped wind mill.

--
Grant. . . .

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor