<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SSH &#8211; Harry Jackson</title>
	<atom:link href="http://127.0.0.1:8090/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://127.0.0.1:8090</link>
	<description>Parent, Painter, Programmer</description>
	<lastBuildDate>Sat, 25 Sep 2004 22:46:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Multiple users and X-Windows</title>
		<link>http://127.0.0.1:8090/multiple_users_and_xwindows.htm</link>
					<comments>http://127.0.0.1:8090/multiple_users_and_xwindows.htm#respond</comments>
		
		<dc:creator><![CDATA[harry]]></dc:creator>
		<pubDate>Sat, 25 Sep 2004 22:46:50 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[SSH]]></category>
		<guid isPermaLink="false">http://www.hjackson.org/wp/?p=171</guid>

					<description><![CDATA[I wanted to open an application today as the Postgres user while logged in as my normal user account. I know that dropping access control to the xserver can be a bit of a security risk but I also don&#8217;t like flicking between users to achieve a task. I don&#8217;t mind opening an xterm but &#8230; <p class="link-more"><a href="http://127.0.0.1:8090/multiple_users_and_xwindows.htm" class="more-link">Continue reading<span class="screen-reader-text"> "Multiple users and X-Windows"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>I wanted to open an application today as the Postgres user while logged in as my normal user account. I know that dropping access control to the xserver can be a bit of a security risk but I also don&#8217;t like flicking between users to achieve a task. I don&#8217;t mind opening an xterm but logging in and out of xwindows is not much fun.<br />
Anyway to get an application working using the insecure method we can do the following. User A is the main user and you want user B to be able to open an app in users A&#8217;s session.<br />
A@machine:~$ xhost +<br />
A@machine:~$ su &#8211; B<br />
password *********<br />
B@machine:~$ export DISPLAY=:0.0<br />
B@machine:~$ /path/to/application/<br />
This was easy but I don&#8217;t like using<br />
A@machine:~$ xhost +<br />
and allowing everyone access. This is not smart so I decided to see if there is a more secure method that avoids this. Having a read of the xhost manual I found out that I could limit access on a per host or per user basis as follows<br />
A@machine:~$ xhost +B@<br />
which gives me a lovely error message as seen below. I have tried various different methods but I get the same error message.<br />
B@ being added to access control list<br />
X Error of failed request:  BadValue (integer parameter out of range for operation)<br />
Major opcode of failed request:  109 (X_ChangeHosts)<br />
Value in failed request:  0xfe<br />
Serial number of failed request:  7<br />
Current serial number in output stream:  9<br />
so it would appear to me that there is something amiss somewhere. I googled for quite a while to see if I could find a definitive answer. No joy, they all recommended using xhost + which is not what I want to do.<br />
Simple things like this can be such a bloody chore under Linux. I know, I know stop bitching and start patching.<br />
Anyway. I can remember doing something similar to what I want with ssh so I had a look at the man page and found the following snippet<br />
-X      Enables X11 forwarding.  This can also be specified on a per-host<br />
basis in a configuration file.<br />
X11 forwarding should be enabled with caution.  Users with the<br />
ability to bypass file permissions on the remote host (for the<br />
user&#8217;s X authorization database) can access the local X11 display<br />
through the forwarded connection.  An attacker may then be able<br />
to perform activities such as keystroke monitoring.<br />
This meant that I could do the following.<br />
A@machine<br />
A@machine:~$ ssh -X B@machine<br />
password ********<br />
B@machine:~$ /path/to/application<br />
and I get the window displayed. Remember that you need to edit the<br />
/etc/ssh/sshd_config<br />
files and set X11forwarding to yes. This is more secure than using xhost + but still not ideal but good enough for what I want it for.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://127.0.0.1:8090/multiple_users_and_xwindows.htm/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
