<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: openssh 5.1 chrootdirectory permissions issue</title>
	<atom:link href="http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/</link>
	<description>Pondering the mystery...</description>
	<pubDate>Wed, 07 Jan 2009 11:22:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: ganymede</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-58</link>
		<dc:creator>ganymede</dc:creator>
		<pubDate>Tue, 02 Dec 2008 22:31:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-58</guid>
		<description>Thanks, the only guide that actually explained what I needed to do to fix the problem.</description>
		<content:encoded><![CDATA[<p>Thanks, the only guide that actually explained what I needed to do to fix the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: T0aD</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-57</link>
		<dc:creator>T0aD</dc:creator>
		<pubDate>Tue, 25 Nov 2008 14:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-57</guid>
		<description>You may also have searched on Google for what to do about it and come away with very little useful information.

Next time try to read the manpage sshd_config(5)

"     ChrootDirectory
             Specifies a path to chroot(2) to after authentication.  This
             path, and all its components, must be root-owned directories that
             are not writable by any other user or group.

"</description>
		<content:encoded><![CDATA[<p>You may also have searched on Google for what to do about it and come away with very little useful information.</p>
<p>Next time try to read the manpage sshd_config(5)</p>
<p>&#8221;     ChrootDirectory<br />
             Specifies a path to chroot(2) to after authentication.  This<br />
             path, and all its components, must be root-owned directories that<br />
             are not writable by any other user or group.</p>
<p>&#8220;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cmsj</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-55</link>
		<dc:creator>cmsj</dc:creator>
		<pubDate>Mon, 17 Nov 2008 13:24:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-55</guid>
		<description>Geophphrie: I'd use the #ifdef section to set a variable to contain the uid and then use one bit of code to check it, rather than duplicate the whole section.
Also I think you should file a bug about this, assuming that upstream care about windows.</description>
		<content:encoded><![CDATA[<p>Geophphrie: I&#8217;d use the #ifdef section to set a variable to contain the uid and then use one bit of code to check it, rather than duplicate the whole section.<br />
Also I think you should file a bug about this, assuming that upstream care about windows.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geophphrie</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-54</link>
		<dc:creator>Geophphrie</dc:creator>
		<pubDate>Tue, 11 Nov 2008 17:39:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-54</guid>
		<description>Thanks for posting this. Since you found the code section, I was able to easily identify and fix the problem using this feature under Cygwin: that the "root" (Administrators) user is uid 544, not 0. I had to compile OpenSSH, of course, but that was worthwhile given that there's really not another reasonable solution for sftp on Windows that doesn't cost $500+ (and also wouldn't integrate into the existing ssh install).

Note that I also adjusted the mode check NOT to check the actual chroot dir; it still checks the dirs leading up to it and requires root ownership still. I have no idea what the security implications of this change are, but it is sufficient for my purposes.

#ifdef HAVE_CYGWIN
        if (st.st_uid != 544 &#124;&#124; (cp != NULL &#38;&#38; (st.st_mode &#38; 022) != 0))
            fatal("bad ownership or modes for chroot "
                "directory %s\"%s\"",
                cp == NULL ? "" : "component ", component);
#endif
#ifndef HAVE_CYGWIN
        if (st.st_uid != 0 &#124;&#124; (st.st_mode &#38; 022) != 0)
            fatal("bad ownership or modes for chroot "
                "directory %s\"%s\"",
                cp == NULL ? "" : "component ", component);
#endif</description>
		<content:encoded><![CDATA[<p>Thanks for posting this. Since you found the code section, I was able to easily identify and fix the problem using this feature under Cygwin: that the &#8220;root&#8221; (Administrators) user is uid 544, not 0. I had to compile OpenSSH, of course, but that was worthwhile given that there&#8217;s really not another reasonable solution for sftp on Windows that doesn&#8217;t cost $500+ (and also wouldn&#8217;t integrate into the existing ssh install).</p>
<p>Note that I also adjusted the mode check NOT to check the actual chroot dir; it still checks the dirs leading up to it and requires root ownership still. I have no idea what the security implications of this change are, but it is sufficient for my purposes.</p>
<p>#ifdef HAVE_CYGWIN<br />
        if (st.st_uid != 544 || (cp != NULL &amp;&amp; (st.st_mode &amp; 022) != 0))<br />
            fatal(&#8221;bad ownership or modes for chroot &#8221;<br />
                &#8220;directory %s\&#8221;%s\&#8221;",<br />
                cp == NULL ? &#8220;&#8221; : &#8220;component &#8220;, component);<br />
#endif<br />
#ifndef HAVE_CYGWIN<br />
        if (st.st_uid != 0 || (st.st_mode &amp; 022) != 0)<br />
            fatal(&#8221;bad ownership or modes for chroot &#8221;<br />
                &#8220;directory %s\&#8221;%s\&#8221;",<br />
                cp == NULL ? &#8220;&#8221; : &#8220;component &#8220;, component);<br />
#endif</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-53</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Mon, 10 Nov 2008 15:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-53</guid>
		<description>Wow... thanks for the hint -- appreciate you taking the time to dig for the answer. :-)</description>
		<content:encoded><![CDATA[<p>Wow&#8230; thanks for the hint &#8212; appreciate you taking the time to dig for the answer. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Webagentur</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-52</link>
		<dc:creator>Webagentur</dc:creator>
		<pubDate>Wed, 05 Nov 2008 15:30:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-52</guid>
		<description>What is that for a tutorial?</description>
		<content:encoded><![CDATA[<p>What is that for a tutorial?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cmsj</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-51</link>
		<dc:creator>cmsj</dc:creator>
		<pubDate>Thu, 30 Oct 2008 20:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-51</guid>
		<description>Marko: you can't do that with the current code. Move your 777 directory inside root:root 644 directory and chroot into that one.</description>
		<content:encoded><![CDATA[<p>Marko: you can&#8217;t do that with the current code. Move your 777 directory inside root:root 644 directory and chroot into that one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marko</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-50</link>
		<dc:creator>Marko</dc:creator>
		<pubDate>Wed, 22 Oct 2008 19:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-50</guid>
		<description>Hey,

but what if I want to have permissions ChrootDirectory set to e.g. 777? The manual suggests I set "StrictModes" to "no", but that didn't work - I still get the same error (bad ownership...)

Thanks,

Marko</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>but what if I want to have permissions ChrootDirectory set to e.g. 777? The manual suggests I set &#8220;StrictModes&#8221; to &#8220;no&#8221;, but that didn&#8217;t work - I still get the same error (bad ownership&#8230;)</p>
<p>Thanks,</p>
<p>Marko</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cmsj</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-49</link>
		<dc:creator>cmsj</dc:creator>
		<pubDate>Mon, 13 Oct 2008 13:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-49</guid>
		<description>Yeah, Minstrel's information about this is very useful, I recommend reading that stuff :)</description>
		<content:encoded><![CDATA[<p>Yeah, Minstrel&#8217;s information about this is very useful, I recommend reading that stuff :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Minstrel</title>
		<link>http://www.tenshu.net/archives/2008/10/09/openssh-51-chrootdirectory-permissions-issue/#comment-48</link>
		<dc:creator>Minstrel</dc:creator>
		<pubDate>Fri, 10 Oct 2008 04:39:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.tenshu.net/?p=236#comment-48</guid>
		<description>Good to see solutions being published to this kind of problem - there are a few others on my Web page at:

http://www.minstrel.org.uk/papers/sftp/

I hope this helps as well.

--
Minstrel</description>
		<content:encoded><![CDATA[<p>Good to see solutions being published to this kind of problem - there are a few others on my Web page at:</p>
<p><a href="http://www.minstrel.org.uk/papers/sftp/" rel="nofollow">http://www.minstrel.org.uk/papers/sftp/</a></p>
<p>I hope this helps as well.</p>
<p>&#8211;<br />
Minstrel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
