svn+ssh

Questions regarding Subversion Server may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.

svn+ssh

Postby kenell » Thu Aug 14, 2008 5:46 pm

Hi,

I am trying to install svn with ssh tunnel on a DS207+. svn is installed (ipk svn .) but I don't understand how i can use ssh. I have tryed and it seems that when using ssh the syno don't find svnserve ( when I logged on the syno using ssh, if I type svnserve it's ok). Is there any tutorial or information? has anyone succeeded ?

best regards
kenell
I'm New!
I'm New!
 
Posts: 4
Joined: Thu Aug 14, 2008 5:42 pm

Re: svn+ssh

Postby Risto » Fri Aug 15, 2008 6:25 pm

To help you out, please provide more information.

1) How did you install the subversion server? Which mode, which user permissions and so on.
2) With which user are you trying to access the svn over ssh? Can you log on with this user per ssh to synology (do you get console access)?

Cheers,
Risto
Risto
Student
Student
 
Posts: 62
Joined: Wed Oct 25, 2006 7:03 pm

Re: svn+ssh

Postby kenell » Fri Aug 15, 2008 7:02 pm

I have installed the subversion package (ipkg )
It seems that I can only use ssh in root Mode ? I can log in root mode with ssh .. it's what i use to install subversion

best regards,
kenell
I'm New!
I'm New!
 
Posts: 4
Joined: Thu Aug 14, 2008 5:42 pm

Re: svn+ssh

Postby Risto » Fri Aug 15, 2008 7:55 pm

Maybe this guide will help you further: http://www.synology.com/wiki/index.php/Step-by-step_guide_to_installing_Subversion
It does not use ssh+svn, instead uses just svn to access Subversion repositories though.

Cheers,
Risto
Risto
Student
Student
 
Posts: 62
Joined: Wed Oct 25, 2006 7:03 pm

Re: svn+ssh

Postby kenell » Sat Aug 16, 2008 7:53 am

I have tryed this, it works, but I need to have a secure access and I don't know how to use svn over ssh.
kenell
I'm New!
I'm New!
 
Posts: 4
Joined: Thu Aug 14, 2008 5:42 pm

Re: svn+ssh

Postby Risto » Sat Aug 16, 2008 10:23 am

Here are the steps to get SVN running over SSH. If someone has a better idea, I would be glad for a update post here.

1) Enable SSH on the Synology Managment UI under Network Services -> Terminal.
2) Create a user under Privileges -> User. In the examples here, I will use JohnDoe.
3) Create a folder for Subversion repositories from Privileges -> Shared Folder, I will use svn. In comparison to inet.d method, here it does not matter what permissions you give under Management UI for this folder.
4) SSH to your Synology (if using Windows, use PuTTY for example), log in as user root, use the admin password.
5) Install the ipkg system (see Synology Wiki for that http://www.synology.com/wiki/index.php/Overview_on_modifying_the_Synology_Server%2C_bootstrap%2C_ipkg_etc)
6) Install subversion with
Code: Select all
ipkg install subversion

7) Install bash with
Code: Select all
ipkg install bash

8) If you don't like editing files with vi, better also install emacs with:
Code: Select all
ipkg install emacs
at this stage.
9) Create /user folder with
Code: Select all
mkdir /user

10) Create /user/JohnDoe folder with
Code: Select all
mkdir /user/JohnDoe

11) Set ownership for the folder with:
Code: Select all
chown JohnDoe.root /user/JohnDoe

12) Edit /etc/passwd with
Code: Select all
emacs /etc/passwd
so that the line for JohnDoe looks like:
Code: Select all
JohnDoe:x:<Number>:<Group>:John Doe:/user/JohnDoe:/opt/bin/bash

where you should keep the <Number> and <Group> fields as they are.
13) Create /user/JohnDoe/.bashrc with content export PATH=/opt/bin:$PATH with emacs or by issuing:
Code: Select all
echo "export PATH=/opt/bin:$PATH" > /user/JohnDoe/.bashrc

14) Set .bashrc ownership to JohnDoe with:
Code: Select all
chown JohnDoe.root /user/JohnDoe/.bashrc

15) Log out as root.
16) Log in over SSH as JohnDoe and check that svnserve is in the path (try to execute it).
17) If that works OK, create a test repository under /volume1/svn with svnadmin create /volume1/svn/test
18) You could try to check it out locally first with:
Code: Select all
svn co svn+ssh://JohnDoe@localhost/volume1/svn/test /volume1/tmp/test

19) If that works, use the same command (replace localhost with correct IP or DNS name) to checkout from remote.

Please note following differences to accessing with svn:// protocol:
1) the Repository has to be writable to all local Synology users, who need to access the repository, not just the user, under which the svnserve daemon runs (as in this case no svn daemon is necessary. If if is running, it will not be used when accessing with svn+ssh). This might require you to create a special group and assign the group write permissions to the repository contents. Be sure to check the s-bits for the folders in this case!
2) When checking out a repository, you must always provide full path to the repository location, as the relative path in inet.d (with the -r option) is not evaluated with svn+ssh method. You do not need to modify /etc/inetd.conf or /etc/services files as discussed in the Step-by-step Subversion tutorial in Wiki which uses inet.d access method. Also no modification should be made under the repositories conf directory.

I hope, this helps you further.

Cheers,
Risto
Risto
Student
Student
 
Posts: 62
Joined: Wed Oct 25, 2006 7:03 pm

Re: svn+ssh

Postby kenell » Mon Aug 18, 2008 1:40 pm

thanks a lot ... it works fine
kenell
I'm New!
I'm New!
 
Posts: 4
Joined: Thu Aug 14, 2008 5:42 pm

Re: svn+ssh

Postby escape » Sun Oct 25, 2009 6:44 pm

The instructions are very clear but I still have the following error:

Code: Select all
bash-3.2$ svn list svn+ssh://svnuser@localhost/repo
svnuser@localhost's password:
bash: svnserve: command not found
svn: Network connection closed unexpectedly
bash-3.2$


I have the /opt/bin where my svnserve lives in my .bashrc path for the svnowner user. If I echo my %PATH I can see that it's there. It still looks like bash doesn't know where svnserve is!

Any guidance would be much appreciated - I feel I'm so close to getting svn+ssh working now.
escape
I'm New!
I'm New!
 
Posts: 1
Joined: Sun Oct 25, 2009 6:39 pm

Re: svn+ssh

Postby Risto » Mon Oct 26, 2009 7:58 pm

Log in as svnuser and look if the svnserve is in your path, for example with:
Code: Select all
which svnserve

If not, add it.

Cheers,
Risto
Risto
Student
Student
 
Posts: 62
Joined: Wed Oct 25, 2006 7:03 pm

Re: svn+ssh

Postby kao » Sun Nov 01, 2009 3:26 pm

Hi,

I use previously Risto instruction to setup two syno ... it works very well ...
last night i upgrade one syno to last 2.2 firmware... and the svn was no more working .... I decide to trash all .... reformat the disk, and reinstall svn from scratch... I follow Risto instruction and I have the same issue as "Escape"..... svnserve command not found..
If I log in terminal using ssh as "svn" user... I can type svnserve... it's in the path... I don't what I can do ?

kao
kao
I'm New!
I'm New!
 
Posts: 3
Joined: Sun Nov 01, 2009 3:10 pm

Re: svn+ssh

Postby kao » Wed Nov 04, 2009 7:02 pm

Please ... anyone can help me ... I have a syno out of work with all my documents that I can't no more synchronize... I have tryed all I can ...
kao
I'm New!
I'm New!
 
Posts: 3
Joined: Sun Nov 01, 2009 3:10 pm

Re: svn+ssh

Postby kao » Tue Nov 10, 2009 7:42 pm

I have add a symlink ... ln -s /opt/bin/svnserve /usr/bin/svnserve and now it works fine :)
kao
I'm New!
I'm New!
 
Posts: 3
Joined: Sun Nov 01, 2009 3:10 pm

Re: svn+ssh

Postby masquerade » Sat Jan 16, 2010 6:39 pm

Hi all

Risto thanks for the tutorial! And thanks to for the symlink. Now everyhinkg works pretty fine for me but:
- I always have to authenticate twice till I get my data checked out? Why and what can I do against that?
- Is there a way users don't have to specify the whole path with the volume1 in it?


Thanks in advance!
masquerade
I'm New!
I'm New!
 
Posts: 2
Joined: Wed Jan 13, 2010 12:20 am

Re: svn+ssh

Postby Risto » Sun Jan 17, 2010 11:13 am

Hi masquerade,

I always have to authenticate twice till I get my data checked out? Why and what can I do against that?

Multiple password queries is normal subversion behavior with authentication. If you do not like that, just save your password (for example with TortoiseSVN), then you get no further password queries. If on the other hand you do not like that, I have unfortunately no tip to change the behavior of just asking the password once.

Is there a way users don't have to specify the whole path with the volume1 in it?

Yes. If you use the -r option by invoking svnserve daemon from /etc/inetd.conf you can specify the path to which the users will be automatically redirected. See more here: http://svnbook.red-bean.com/en/1.5/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.invoking.daemon

Cheers,
Risto
Risto
Student
Student
 
Posts: 62
Joined: Wed Oct 25, 2006 7:03 pm

Re: svn+ssh

Postby winfree » Fri Feb 26, 2010 5:01 am

Is there any reason why not to use /home instead of /user?
winfree
I'm New!
I'm New!
 
Posts: 2
Joined: Fri Feb 26, 2010 4:59 am

Next

Return to Subversion Server

Who is online

Users browsing this forum: No registered users and 0 guests