<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="/templates/default/atom.css" type="text/css" ?>

<feed 
   xmlns="http://www.w3.org/2005/Atom"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    
    <link href="http://patrick.georgi-clan.de/feeds/atom.xml" rel="self" title="TOP5: Diverses, Verschiedenes, ..." type="application/atom+xml" />
    <link href="http://patrick.georgi-clan.de/"                        rel="alternate"    title="TOP5: Diverses, Verschiedenes, ..." type="text/html" />
    <link href="http://patrick.georgi-clan.de/rss.php?version=2.0"     rel="alternate"    title="TOP5: Diverses, Verschiedenes, ..." type="application/rss+xml" />
    <title type="html">TOP5: Diverses, Verschiedenes, ...</title>
    <subtitle type="html">alles, was mir so einfällt</subtitle>
    <icon>http://patrick.georgi-clan.de/templates/default/img/s9y_banner_small.png</icon>
    <id>http://patrick.georgi-clan.de/</id>
    <updated>2011-05-12T17:41:43Z</updated>
    <generator uri="http://www.s9y.org/" version="1.5.5">Serendipity 1.5.5 - http://www.s9y.org/</generator>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:patrick@georgi-clan.de" />

    <entry>
        <link href="http://patrick.georgi-clan.de/archives/113-Tunneling-svnserve-through-SSH-the-right-waytm.html" rel="alternate" title="Tunneling svnserve through SSH the right way[tm]" />
        <author>
            <name>Patrick Georgi</name>
            <email>patrick@georgi-clan.de</email>        </author>
    
        <published>2011-05-12T17:38:00Z</published>
        <updated>2011-05-12T17:41:43Z</updated>
        <wfw:comment>http://patrick.georgi-clan.de/wfwcomment.php?cid=113</wfw:comment>
    
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://patrick.georgi-clan.de/rss.php?version=atom1.0&amp;type=comments&amp;cid=113</wfw:commentRss>
    
            <category scheme="http://patrick.georgi-clan.de/categories/5-Software" label="Software" term="Software" />
    
        <id>http://patrick.georgi-clan.de/archives/113-guid.html</id>
        <title type="html">Tunneling svnserve through SSH the right way[tm]</title>
        <content type="xhtml" xml:base="http://patrick.georgi-clan.de/">
            <div xmlns="http://www.w3.org/1999/xhtml">
                <p>I had to setup some SVN repositories in a quite restrictive network today: HTTP works through proxy, and SSH is available.</p> 
<p>Options:</p> 
<ul> 
<li>Setup web access (downside: harder to manage with write access)</li> 
<li>Use svn+ssh protocol (downside: spawns a separate server process that tries to use the repo)</li> 
<li>Use ssh port forwarding (downside: SSH must be started before)<br /></li> 
<li>Do it properly!</li> 
</ul>I opted for &quot;properly&quot;, and here's how:






<ol> 
<li>Make sure, netcat exists on the server</li> 
<li>Make sure, ssh access to the server exists (can be a limited ssh account that can only run a single command, and SSH is not used for svn authentication at all)</li> 
<li>Create a script on the client calling &quot;<code>ssh $1 netcat localhost 3690</code>&quot;</li> 
<li>Set up a tunnel in <code>~/.subversion/config</code>, eg. (in section <code>[tunnel]</code>) &quot;<code>tunnel = /path/to/clientscript</code>&quot;</li> 
<li>Access the repo with svn-tunnel://host/path</li> 
</ol> 
<p>And that's all there is to it: svn-tunnel gets routed to the &quot;<code>tunnel = </code>&quot; line, so svn calls the client script with arguments &quot;<code>$host svnserve -t</code>&quot;, so the client script creates an ssh connection to the server $host, with the command &quot;<code>netcat localhost 3690</code>&quot; to be run on the server.</p> 
<p>The server calls &quot;<code>netcat localhost 3690</code>&quot;, providing the svnserve protocol to stdin/stdout like any good tunnel should do, and svn authenticates over it.</p> 
<p>For larger deployments, there could be a special ssh user available to all (no auth at all) providing SSH tunneled access to svnserve.</p> 
<p>If only subversion knew some substitution syntax, the client side script could be dropped, too (eg. &quot;tunnel = ssh %h netcat localhost 3690&quot;)<br /></p> 
            </div>
        </content>
        
    </entry>

</feed>
