<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=How_to_access_X11_Forwarding_after_becoming_root</id>
	<title>How to access X11 Forwarding after becoming root - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.docking.org/index.php?action=history&amp;feed=atom&amp;title=How_to_access_X11_Forwarding_after_becoming_root"/>
	<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=How_to_access_X11_Forwarding_after_becoming_root&amp;action=history"/>
	<updated>2026-04-09T19:39:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>http://wiki.docking.org/index.php?title=How_to_access_X11_Forwarding_after_becoming_root&amp;diff=10134&amp;oldid=prev</id>
		<title>Benrwong: how to troubleshoot x11 issues after sudo/su</title>
		<link rel="alternate" type="text/html" href="http://wiki.docking.org/index.php?title=How_to_access_X11_Forwarding_after_becoming_root&amp;diff=10134&amp;oldid=prev"/>
		<updated>2017-06-06T23:49:29Z</updated>

		<summary type="html">&lt;p&gt;how to troubleshoot x11 issues after sudo/su&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;We&amp;#039;re used to activating X11 forwarding when we SSH into a remote host.  Everyone knows it by now:&lt;br /&gt;
 ssh -X [or -Y] user@remotehost&lt;br /&gt;
&lt;br /&gt;
Though sometimes, we have to become root and use a graphical program afterwards.  You may know that after becoming root through sudo or su, X11 doesn&amp;#039;t work anymore.  You get an error that looks like this: &lt;br /&gt;
 -sh-4.1$ sudo -i&lt;br /&gt;
 [sudo] password for generic_user: &lt;br /&gt;
 [root@vav ~]# virt-manager&lt;br /&gt;
 X11 connection rejected because of wrong authentication.&lt;br /&gt;
 Unable to initialize GTK: could not open display&lt;br /&gt;
&lt;br /&gt;
This is because root does not have the same .Xauthority contents as the user who originally SSH&amp;#039;d in.  &lt;br /&gt;
If you want to activate X11 forwarding, you&amp;#039;ll have to copy the contents of the user&amp;#039;s .Xauthority file into root&amp;#039;s .Xauthority file.&lt;br /&gt;
 [root@vav ~]# xauth add $(xauth -f ~generic_user/.Xauthority list | tail -1)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Sysadmin]]&lt;/div&gt;</summary>
		<author><name>Benrwong</name></author>
	</entry>
</feed>