<?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>cameronyule.com &#187; linux</title>
	<atom:link href="http://cameronyule.com/tags/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://cameronyule.com</link>
	<description>Glasgow based new media developer Cameron Yule.</description>
	<lastBuildDate>Fri, 22 Jan 2010 12:53:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Multiple users with svn+ssh</title>
		<link>http://cameronyule.com/2008/07/multiple-users-with-svnssh</link>
		<comments>http://cameronyule.com/2008/07/multiple-users-with-svnssh#comments</comments>
		<pubDate>Fri, 11 Jul 2008 09:07:54 +0000</pubDate>
		<dc:creator>Cameron</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnserve]]></category>

		<guid isPermaLink="false">http://cameronyule.com/?p=54</guid>
		<description><![CDATA[Following on from my last post on moving from svnserve to svn+ssh, I had to then get this setup working for multiple users. This is how I achieved it on CentOS 5.2, hopefully it&#8217;ll prove useful for someone else. This is based on a tutorial I found on the subversion dev mailing list. # We [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from my last post on <a href="http://cameronyule.com/2008/07/moving-from-svnserve-to-svnssh">moving from svnserve to svn+ssh</a>, I had to then get this setup working for multiple users. This is how I achieved it on CentOS 5.2, hopefully it&#8217;ll prove useful for someone else.</p>
<p>This is based on a <a href="http://svn.haxx.se/dev/archive-2004-03/0253.shtml">tutorial</a> I found on the subversion dev mailing list.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># We need a group for our svn users</span>
groupadd svnusers
&nbsp;
<span style="color: #666666; font-style: italic;"># Add the users</span>
useradd <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">-g</span> svnusers <span style="color: #666666; font-style: italic;"># this is the svn 'admin' user</span>
useradd user1 <span style="color: #660033;">-g</span> svnusers
useradd user2 <span style="color: #660033;">-g</span> svnusers
useradd user3 <span style="color: #660033;">-g</span> svnusers
useradd user4 <span style="color: #660033;">-g</span> svnusers
<span style="color: #666666; font-style: italic;"># … etc</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Edit each svn user's .bashrc file, e.g.</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - user1
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> .bashrc
&nbsp;
<span style="color: #666666; font-style: italic;"># Add the followng line to the bottom</span>
<span style="color: #7a0874; font-weight: bold;">umask</span> 002 <span style="color: #666666; font-style: italic;"># allow user + group to write, no other. </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create the dir where we're storing the repo (as root)</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories
&nbsp;
<span style="color: #666666; font-style: italic;"># Set permissions on our new dir</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root.svnusers <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> u+wrx,g+wrx,o-wxr <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> root.svnusers <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion
&nbsp;
<span style="color: #666666; font-style: italic;"># The following may be overkill</span>
<span style="color: #666666; font-style: italic;"># chown -R root.svnusers /usr/share</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Rename the original svnserve command into svnserve.bin </span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svnserve</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>svnserve.bin
&nbsp;
<span style="color: #666666; font-style: italic;"># Create a new svnserve file</span>
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svnserve</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Paste the following into nano and save as svnserve</span>
<span style="color: #666666; font-style: italic;">#!/bin/sh </span>
<span style="color: #666666; font-style: italic;"># wrap in order to put root in by default </span>
<span style="color: #666666; font-style: italic;"># Script implemented by Adrian Robert &lt;arobert @cogsci.ucsd.edu&gt; </span>
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>svnserve.bin <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories <span style="color: #ff0000;">&quot;$@&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make our svnserve wrapper executable</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> u+wrx,g+rx-w,o+xr-w <span style="color: #c20cb9; font-weight: bold;">svnserve</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> u+wrx,g+rx-w,o+xr-w <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svnserve</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log in as the svn user</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> - <span style="color: #c20cb9; font-weight: bold;">svn</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create our repos</span>
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>projects
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>repositories<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>conf 
&nbsp;
<span style="color: #666666; font-style: italic;"># Edit the repo conf</span>
<span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> svnserve.conf
&nbsp;
<span style="color: #666666; font-style: italic;"># Add the following under the [general] header</span>
anon-access = none
auth-access = <span style="color: #c20cb9; font-weight: bold;">write</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://cameronyule.com/2008/07/multiple-users-with-svnssh/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Moving from svnserve to svn+ssh</title>
		<link>http://cameronyule.com/2008/07/moving-from-svnserve-to-svnssh</link>
		<comments>http://cameronyule.com/2008/07/moving-from-svnserve-to-svnssh#comments</comments>
		<pubDate>Wed, 09 Jul 2008 11:22:54 +0000</pubDate>
		<dc:creator>Cameron</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[svnserve]]></category>

		<guid isPermaLink="false">http://cameronyule.com/?p=53</guid>
		<description><![CDATA[After mentioning that I was using svnserve, a friend sent me a twitter message asking why I wasn&#8217;t using svn+ssh, so I thought I&#8217;d have a look. It turned out to be really simple to make the move, and I&#8217;m left with a nicer setup than before. Firstly, let&#8217;s kill the running svnserve process as [...]]]></description>
			<content:encoded><![CDATA[<p>After mentioning that I was using svnserve, a friend sent me a twitter message asking why I wasn&#8217;t using svn+ssh, so I thought I&#8217;d have a look. It turned out to be really simple to make the move, and I&#8217;m left with a nicer setup than before.</p>
<p>Firstly, let&#8217;s kill the running svnserve process as we&#8217;re not going to be using that anymore.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>user<span style="color: #000000; font-weight: bold;">@</span>server ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">ps</span> aux <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>
user     <span style="color: #000000;">2495</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.3</span>  <span style="color: #000000;">45856</span>   <span style="color: #000000;">940</span> ?          Ss    <span style="color: #000000;">20</span>:02   <span style="color: #000000;">0</span>:00 <span style="color: #c20cb9; font-weight: bold;">svnserve</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-r</span> repository<span style="color: #000000; font-weight: bold;">/</span>
user     <span style="color: #000000;">2501</span>  <span style="color: #000000;">0.0</span>  <span style="color: #000000;">0.2</span>   <span style="color: #000000;">3936</span>    <span style="color: #000000;">724</span> pts<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span>     S+   <span style="color: #000000;">20</span>:02   <span style="color: #000000;">0</span>:00 <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>user<span style="color: #000000; font-weight: bold;">@</span>server ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000;">2495</span></pre></div></div>

<p>If you&#8217;ve specifically opened port 3690 (which is the default svnserve port) in your firewall you should close that again now. You can check your current firewall ruleset using the list flag.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>user<span style="color: #000000; font-weight: bold;">@</span>server ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ iptables <span style="color: #660033;">--list</span></pre></div></div>

<p>I happen to run ssh on a non-standard port, so to save myself having to specify this each time I&#8217;ve overridden the default tunnel subversion has setup for ssh. This stage is run on your local machine (or where you want to check out your repository).</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">local</span>:~ cameron$ <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #660033;">-w</span> .subversion<span style="color: #000000; font-weight: bold;">/</span>config</pre></div></div>

<p>Under the [tunnels] section, I added the following line. Note that XXXX is where my non-standard port is specified, and REMOTEUSERNAME is the username I&#8217;m using to connect to the server to checkout my repository. The -C flag enables compression, and seems to greatly speed things up.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> = <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-p</span> XXXX <span style="color: #660033;">-l</span> REMOTEUSERNAME <span style="color: #660033;">-C</span></pre></div></div>

<p>Okay, so let&#8217;s try and check something out! I&#8217;m hoping you have ssh keys configured already, but if not here&#8217;s an <a href="http://www.sshkeychain.org/mirrors/SSH-with-Keys-HOWTO/SSH-with-Keys-HOWTO.html">SSH Keys Howto</a>. Note you have to specify absolute paths now.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">local</span>:~ cameron$ <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">co</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>yoururl<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>trunk
A    trunk<span style="color: #000000; font-weight: bold;">/</span>wp-config.php
A    trunk<span style="color: #000000; font-weight: bold;">/</span>wp-pass.php
A    trunk<span style="color: #000000; font-weight: bold;">/</span>wp-rss.php
…</pre></div></div>

<p>With any luck, that&#8217;ll checkout your repository. </p>
<p>If you already have a repository checked out and don&#8217;t want to delete it and checkout again, there&#8217;s a solution for you too. Change into your local working copy and run the following;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">local</span>:projects cameron$ <span style="color: #c20cb9; font-weight: bold;">svn</span> switch <span style="color: #660033;">--relocate</span> <span style="color: #c20cb9; font-weight: bold;">svn</span>:<span style="color: #000000; font-weight: bold;">//</span>yoururl<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>trunk <span style="color: #c20cb9; font-weight: bold;">svn</span>+<span style="color: #c20cb9; font-weight: bold;">ssh</span>:<span style="color: #000000; font-weight: bold;">//</span>yoururl<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://cameronyule.com/2008/07/moving-from-svnserve-to-svnssh/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

