I have set up a svn repository that I want to access via svn+ssh.
For that purpose, I followed the instructions given in http://svnbook.red-bean.com/en/1.7/svn-book.pdf. That is, I edited the file ~/.ssh/authorized_keys to include the following line:
command="svnserve -t -r /home/USER/svn --config-file=/home/USER/svn/conf/svnserve.conf --tunnel-user=SVN-USER" ssh-rsa PUBLIC-KEY USERNAME-COMMENT
I am succeeding to do checkout, commit, etc., via svn-ssh -- so the instructions given in the before-mentioned PDF work. However, since I have added that line, I cannot log into the server via ordinary SSH anymore. When logging in, the console shows:
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay inherited-props ephemeral-txnprops file-revs-reverse ) ) )
and whenever I type anything into the console, I am disconnected.
I guess it is because the command svnserve is executed when logging in. However, the instructions say that I should still be able to access via ssh. So why ain't I? Any hints on what I need to do so I am still able to access my server via ssh without losing the capability to access my repository via svn+ssh?
You will not be able to login until the "command" is present in the authorized_keys next to your key. It's mentioned in the PDF that the command will be executed on any login attempt.
There is one trick which you can use. Have 2 sets of keys, one you will use to login and the other to have SVN working. This would work because the command is only executed if the associated key is actually used to login.
On the host where you login from you probably have now 2 files: .ssh/id_rsa and .ssh/id_rsa.pub. You need to create a new pair "ssh-keygen -f ~/.ssh/id_login". Copy the content of ~/.ssh/id_login.pub" to the authorized_keys on the destination host, then when you login to that host use "ssh -i ~/.ssh/id_login HOST".
Basically you should have 2 lines in the authorized_keys:
To use automatically the identity you may add the following lines to the .ssh/config on your workstation:
You may define any Host label you want to have it easier and use "ssh label" to connect.