11.07.2015 Views

Version Control with Subversion - Login

Version Control with Subversion - Login

Version Control with Subversion - Login

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Server Configuration<strong>with</strong> specific options. In this case, accessing an svn+joessh:// URL would invoke theparticular SSH binary <strong>with</strong> -p 29934 as arguments—useful if you want the tunnel programto connect to a nonstandard port.Second, it shows how to define a custom environment variable that can override the nameof the tunneling program. Setting the SVN_SSH environment variable is a convenient wayto override the default SSH tunnel agent. But if you need to have several different overridesfor different servers, each perhaps contacting a different port or passing a differentset of options to SSH, you can use the mechanism demonstrated in this example. Now ifwe were to set the JOESSH environment variable, its value would override the entire valueof the tunnel variable—$JOESSH would be executed instead of /opt/alternate/ssh-p 29934.SSH configuration tricksInitial setupIt's possible to control not only the way in which the client invokes ssh, but also to controlthe behavior of sshd on your server machine. In this section, we'll show how to control theexact svnserve command executed by sshd, as well as how to have multiple users sharea single system account.To begin, locate the home directory of the account you'll be using to launch svnserve.Make sure the account has an SSH public/private keypair installed, and that the user canlog in via public-key authentication. Password authentication will not work, since all of thefollowing SSH tricks revolve around using the SSH authorized_keys file.If it doesn't already exist, create the authorized_keys file (on Unix, typically~/.ssh/authorized_keys). Each line in this file describes a public key that is allowedto connect. The lines are typically of the form:ssh-dsa AAAABtce9euch… user@example.comThe first field describes the type of key, the second field is the base64-encoded key itself,and the third field is a comment. However, it's a lesser known fact that the entire line canbe preceded by a command field:command="program" ssh-dsa AAAABtce9euch… user@example.comWhen the command field is set, the SSH daemon will run the named program instead ofthe typical tunnel-mode svnserve invocation that the <strong>Subversion</strong> client asks for. Thisopens the door to a number of server-side tricks. In the following examples, we abbreviatethe lines of the file as:command="program" TYPE KEY COMMENT<strong>Control</strong>ling the invoked commandBecause we can specify the executed server-side command, it's easy to name a specificsvnserve binary to run and to pass it extra arguments:command="/path/to/svnserve -t -r /virtual/root" TYPE KEY COMMENTIn this example, /path/to/svnserve might be a custom wrapper script around svnservewhich sets the umask (see the section called “Supporting Multiple Repository Ac-168

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!