By seanmcelholm
I got an SVN repository installed on my vps, but it is publically accessable, how do I make it private? I.e, requires a password to read the content.
Writing isn’t an issue as a password is already needed for that anyway.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
How did you setup the svn repository? It sounds like you are serving it over HTTP with Apache perhaps?
I find the easiest way to server a private repo is to use the svn+ssh:// protocol rather than HTTP. That way, you can manage access to it via a normal user account. For instance, if we wanted to set up an svn user:
sudo adduser svn
cd /home/svn/
sudo -u svn mkdir project
sudo -u svn svnadmin create /home/svn/myproject
You would then be able to access it with the same password you set when running adduser svn when running:
svn co svn+ssh://svn@159.203.24.122/home/svn/myproject
You can also add SSH public keys to /home/svn/.ssh/authorized_keys in order to grant access to the private repo without sharing the password.
If you are allowing others to use the repo, you’ll want to make sure that the svn user can’t log in to the server itself and only be used via svn+ssh://
Edit the file /etc/ssh/sshd_config and append:
Match User svn
ForceCommand /usr/bin/svnserve -t
Finally, restart SSH for the changes to take effect:
sudo service ssh restart
This wiki page goes over a few other options as well.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.