Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RISOLTO CON WORKAROUND] Invalid MIT-MAGIC-COOKIE-1 da root
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3056
Location: ROMA

PostPosted: Tue Oct 18, 2011 7:03 am    Post subject: [RISOLTO CON WORKAROUND] Invalid MIT-MAGIC-COOKIE-1 da root Reply with quote

Salve a tutti,

sono ormai due anni (forse anche di più) che combatto con questo problema, ovvero ogni volta che tento di avviare una qualsiasi applicazione grafica da utente root (dopo aver effettuato il comando "su") ottengo questo messaggio di errore:
Invalid MIT-MAGIC-COOKIE-1 keyWarning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s


E questo accade sia che io provi a lanciare xterm, sia Xephyr, che qualsiasi altro programma di questo tipo.

Anzi, con Xephyr risponde così:
Invalid MIT-MAGIC-COOKIE-1 key
Xephyr cannot open host display. Is DISPLAY set?


L'unico modo che io ho per risolvere questo problema è quello di usare il seguente comando per avviare, ad esempio, xterm:
Code:
sudo su - -c "xauth merge $HOME/.Xauthority;export DISPLAY=:0.0 && xterm"

E va usato da utente normale.

Questo problema si verifica solo se io sono un utente normale e divento root usando "su".
Se invece effettuo il login come utente root, quando sono su KDM, allora il problema non si pone. Ma non voglio ovviare a questo problema facendo sempre login come root.


In precedenza adottavo anche altri sistemi, meno comodi, per ovviare al problema, ma al momento, il comando qui sopra è l'unico che mi permette di risolvere.
Ricordo che una volta su Gentoo era possibile avviare i comandi come xterm anche da root dopo aver fatto "su" (si parla del 2006-2007), ma poi ho sempre avuto problemi.


Il fatto ancor più rognoso è che questa cosa su Debian (ad esempio) non succede.

Come si può porre fine a questa rottura?
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered


Last edited by fbcyborg on Thu Oct 20, 2011 7:30 am; edited 1 time in total
Back to top
View user's profile Send private message
Zizo
Apprentice
Apprentice


Joined: 04 Feb 2010
Posts: 200
Location: Padova, Italy

PostPosted: Tue Oct 18, 2011 10:35 am    Post subject: Reply with quote

Come palliativo potresti utilizzare questo, ma non garantisce la stessa sicurezza:

cat /etc/X11/xinit/xinitrc.d/05-root
Code:
#!/bin/sh
[ -x /usr/bin/xhost ] && xhost +si:localuser:root > /dev/null 2>&1

ls /etc/X11/xinit/xinitrc.d/05-root
Code:
-rwxr-xr-x 1 root root 419 ** *** *** /etc/X11/xinit/xinitrc.d/05-root


Eventualmente anche un link tra ${HOME}/.Xauthority e /root/.Xauthority dovrebbe funzionare, oppure il modificare .bashrc di root aggiungendo "export XAUTHORITY=/home/utente/.Xauthority" (suppongo).
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3056
Location: ROMA

PostPosted: Tue Oct 18, 2011 12:25 pm    Post subject: Reply with quote

Molto bene, ti ringrazio.

Posso sapere esattamente cosa significherebbe questa modifica? E cosa intendi quando parli di sicurezza?

Grazie!
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
eleaffar
n00b
n00b


Joined: 09 May 2011
Posts: 43

PostPosted: Wed Oct 19, 2011 8:06 am    Post subject: Re: Invalid MIT-MAGIC-COOKIE-1 da root Reply with quote

fbcyborg wrote:
Salve a tutti,

sono ormai due anni (forse anche di più) che combatto con questo problema, ovvero ogni volta che tento di avviare una qualsiasi applicazione grafica da utente root (dopo aver effettuato il comando "su") ottengo questo messaggio di errore:
Invalid MIT-MAGIC-COOKIE-1 keyWarning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s

....

Io uso sux ? Ci sono controindicazioni ??? Quali ?
_________________
Ho visto il film Memento ... non me lo ricordo !
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3056
Location: ROMA

PostPosted: Wed Oct 19, 2011 8:10 am    Post subject: Reply with quote

Interessante questo programma!!!
Lo installo appena possibile, però ho appena notato una cosa stranissima: sul mio notebook, riesco tranquillamente ad avviare xterm dopo aver fatto "su". E non ho la più pallida idea di come ciò sia possibile e del perché non mi dia questo Invalid MIT-MAGIC-COOKIE-1!!!

EDIT: provato sux e devo dire che è formidabile. Però vorrei capire come risolvere il problema lo stesso, perché dev'essere qualche impostazione fatta male, dato che sul mio notebook non ho questo problema.
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3056
Location: ROMA

PostPosted: Mon Oct 24, 2011 7:09 am    Post subject: Reply with quote

Non capisco, sul mio notebook non ho problemi ad eseguire xterm dopo aver fatto "su" dal mio utente usuale, ma se creo un utente di test non funziona!
Ci dev'essere qualche impostazione sul mio user che mi fa evitare il problema. :?
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum