LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-12-2017, 04:42 PM   #1
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Rep: Reputation: Disabled
Cool SVN+SSH with RSA Public/Private Key


Let me start by saying that I'm a programmer and database developer...not a networking or IT admin. I'm just trying to setup a lowly SVN Server with SSH using public/private keys on my Fedora 25 server to help keep my versions straight.

My issue is not with generating the keys, but with the svn or ssh config. I used puttygen to generate my SSH-2 RSA public and private keys. I added the line
Code:
"command svn -t ..."
as shown below to the public key and saved the file as /home/svn/.ssh/authorized_keys. Then I setup putty using the ip address, port, and private key (.ppk) file. When I try and connect with Putty it says "Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex-with-mic). I know that the sshd is running and working because yesterday I setup ssh to this server for another username and it works fine with the key I generated yesterday (through putty on windows - totally unrelated to this svn setup). My first thought is that it is because of the line added to the top of the authorized_keys file, but I don't know. Is it a problem to have different authorized_keys in different /home/username/.ssh directories?

Anyway, then I did the following to install and configure svn:
Code:
[svn@zdt ~]$ su
Password: 
[root@zdt svn]# gpasswd -a svn svn_group
Adding user svn to group svn_group
[root@zdt svn]# less /etc/group
[root@zdt svn]# gpasswd -a svn wheel
Adding user svn to group wheel
[root@zdt svn]# dnf install subversion
Last metadata expiration check: 3:45:06 ago on Wed Apr 12 17:54:57 2017.
Dependencies resolved.
================================================================================
 Package                Arch          Version              Repository      Size
================================================================================
Installing:
 libserf                x86_64        1.3.9-1.fc25         fedora          56 k
 subversion             x86_64        1.9.5-1.fc25         updates        1.1 M
 subversion-libs        x86_64        1.9.5-1.fc25         updates        1.3 M

Transaction Summary
================================================================================
Install  3 Packages

Total download size: 2.5 M
Installed size: 9.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): libserf-1.3.9-1.fc25.x86_64.rpm          129 kB/s |  56 kB     00:00    
(2/3): subversion-1.9.5-1.fc25.x86_64.rpm       994 kB/s | 1.1 MB     00:01    
(3/3): subversion-libs-1.9.5-1.fc25.x86_64.rpm  878 kB/s | 1.3 MB     00:01    
--------------------------------------------------------------------------------
Total                                           1.0 MB/s | 2.5 MB     00:02     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : libserf-1.3.9-1.fc25.x86_64                                 1/3 
  Installing  : subversion-libs-1.9.5-1.fc25.x86_64                         2/3 
  Installing  : subversion-1.9.5-1.fc25.x86_64                              3/3 
  Verifying   : subversion-1.9.5-1.fc25.x86_64                              1/3 
  Verifying   : libserf-1.3.9-1.fc25.x86_64                                 2/3 
  Verifying   : subversion-libs-1.9.5-1.fc25.x86_64                         3/3 

Installed:
  libserf.x86_64 1.3.9-1.fc25               subversion.x86_64 1.9.5-1.fc25      
  subversion-libs.x86_64 1.9.5-1.fc25      

Complete!
[root@zdt svn]# cd /home/svn
[root@zdt svn]# ls
Desktop  Documents  Downloads  Music  Pictures  Public  Templates  Videos
[root@zdt svn]# cd Documents
[root@zdt svn]# mkdir repos
[root@zdt svn]# chown svn:svn -R repos
[root@zdt svn]# chmod -R 775 repos 
[root@zdt svn]# ls -al
total 28
drwx------. 17 svn  svn  4096 Apr 12 21:45 .
drwxr-xr-x.  4 root root   32 Apr 12 20:29 ..
-rw-------.  1 svn  svn   538 Apr 12 21:30 .bash_history
-rw-r--r--.  1 svn  svn    18 Sep 30  2016 .bash_logout
-rw-r--r--.  1 svn  svn   193 Sep 30  2016 .bash_profile
-rw-r--r--.  1 svn  svn   231 Sep 30  2016 .bashrc
drwx------. 10 svn  svn   230 Apr 12 21:32 .cache
drwxr-xr-x. 13 svn  svn   250 Apr 12 21:32 .config
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Desktop
drwxrwxr-x.  3 svn  svn    43 Apr 12 21:25 Documents
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Downloads
-rw-------.  1 svn  svn    16 Apr 12 21:31 .esd_auth
drwx------.  2 svn  svn    80 Apr 12 21:32 .gnupg
-rw-------.  1 svn  svn   310 Apr 12 21:31 .ICEauthority
drwx------.  3 svn  svn    19 Apr 12 21:31 .local
drwxr-xr-x.  4 svn  svn    39 Apr  5 18:48 .mozilla
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Music
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Pictures
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Public
drwxrwxr-x.  3 svn  svn    23 Apr 12 21:45 repos
drwx------.  2 svn  svn    29 Apr 12 20:49 .ssh
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Templates
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Videos
[root@zdt svn]# cd repos
[root@zdt repos]# mv /home/svn/Documents/svnwrapper.sh /home/svn/repos
[root@zdt repos]# ls
svnwrapper.sh
[root@zdt repos]# vi svnwrapper.sh
[root@zdt repos]# chmod 755 /home/svn/repos/svnwrapper.sh
[root@zdt repos]# ls -al
total 8
drwxrwxr-x.  3 svn  svn    44 Apr 12 21:47 .
drwx------. 17 svn  svn  4096 Apr 12 21:45 ..
-rwxr-xr-x.  1 root root  183 Apr 12 21:47 svnwrapper.sh
[root@zdt repos]# chown svn:svn svnwrapper.sh
[root@zdt repos]# ls -al
total 8
drwxrwxr-x.  3 svn svn   44 Apr 12 21:47 .
drwx------. 17 svn svn 4096 Apr 12 21:45 ..
-rwxr-xr-x.  1 svn svn  183 Apr 12 21:47 svnwrapper.sh
[root@zdt repos]# cd /usr/local/bin
[root@zdt bin]# rm svnserve
rm: remove symbolic link 'svnserve'? y
[root@zdt bin]# ln -s /home/svn/repos/svnwrapper.sh svnserve
[root@zdt bin]# cd /home/svn
[root@zdt svn]# ls -al
total 28
drwx------. 17 svn  svn  4096 Apr 12 21:45 .
drwxr-xr-x.  4 root root   32 Apr 12 20:29 ..
-rw-------.  1 svn  svn   538 Apr 12 21:30 .bash_history
-rw-r--r--.  1 svn  svn    18 Sep 30  2016 .bash_logout
-rw-r--r--.  1 svn  svn   193 Sep 30  2016 .bash_profile
-rw-r--r--.  1 svn  svn   231 Sep 30  2016 .bashrc
drwx------. 10 svn  svn   230 Apr 12 21:32 .cache
drwxr-xr-x. 13 svn  svn   250 Apr 12 21:32 .config
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Desktop
drwxrwxr-x.  3 svn  svn    22 Apr 12 21:46 Documents
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Downloads
-rw-------.  1 svn  svn    16 Apr 12 21:31 .esd_auth
drwx------.  2 svn  svn    80 Apr 12 21:32 .gnupg
-rw-------.  1 svn  svn   310 Apr 12 21:31 .ICEauthority
drwx------.  3 svn  svn    19 Apr 12 21:31 .local
drwxr-xr-x.  4 svn  svn    39 Apr  5 18:48 .mozilla
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Music
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Pictures
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Public
drwxrwxr-x.  3 svn  svn    44 Apr 12 21:47 repos
drwx------.  2 svn  svn    29 Apr 12 20:49 .ssh
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Templates
drwxr-xr-x.  2 svn  svn     6 Apr 12 21:31 Videos
[root@zdt svn]# cd repos
[root@zdt repos]# ls
svnwrapper.sh
[root@zdt repos]# svnadmin create /home/svn/repos/occo_repo
[root@zdt repos]# ls
occo_repo  svnwrapper.sh
[root@zdt repos]# cd occo_repo
[root@zdt occo_repo]# ls
conf  db  format  hooks  locks  README.txt
[root@zdt occo_repo]# cd /home/svn/.ssh
[root@zdt .ssh]# ls
authorized_keys
[root@zdt .ssh]# cat authorized_keys
command="svnserve -t -r /home/svn --tunnel-user=svn",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa <redacted>= rsa-key-20170412
[root@zdt ssh]# cd /home/svn/repos/occo_repo
[root@zdt occo_repo]# ls
conf  db  format  hooks  locks  README.txt
[root@zdt occo_repo]# mkdir acct
[root@zdt occo_repo]# mkdir acct/trunk
[root@zdt occo_repo]# mkdir acct/tags
[root@zdt occo_repo]# mkdir acct/branches
[root@zdt occo_repo]# svn import acct svn+ssh://svn@<redacted ip>/occo_repo -m 'initial import'
svn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@<redacted ip>/occo_repo'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
[root@zdt occo_repo]# svn import acct svn+ssh://svn@zdt_svn/occo_repo -m 'initial import'
 
^Csvn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@zdtsvn/occo_repo'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
[root@zdt occo_repo]# cd /home/svn/.ssh
[root@zdt .ssh]# ls -al
total 8
drwx------.  2 svn svn   29 Apr 12 20:49 .
drwx------. 18 svn svn 4096 Apr 12 22:00 ..
-rw-r--r--.  1 svn svn  854 Apr 12 21:12 authorized_keys
[root@zdt .ssh]# vi authorized_keys
[root@zdt .ssh]# svn import acct svn+ssh://svn@zdt_svn/occo_repo -m 'initial import'
svn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@zdt_svn/occo_repo'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
[root@zdt .ssh]# vi authorized_keys[root@zdt .ssh]# svn import acct svn+ssh://svn@zdt_svn/occo_repo -m 'initial import'
^Csvn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@zdt_svn/occo_repo'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
I'm completely lost now. I tried reading the svn book, but my server admin skills have been found lacking. I tried editing the .subversion file in my home directory. I am a failure and I have been wandering around on the ice for three days now while all the other penguins are happily finding delicious penguin food on their servers. Can anyone send me in the right direction please?


Rachael

Last edited by rachaelw; 04-14-2017 at 03:13 PM. Reason: Add information
 
Old 04-13-2017, 12:25 PM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,747

Rep: Reputation: 131Reputation: 131
Code:
[root@zdt .ssh]# cat authorized_keys
command="svnserve -t -r /home/svn --tunnel-user=svn",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa <redacted>= rsa-key-20170412
I have never seen that as an authorized_keys file it is always in my experience with using it the the contents of the id_rsa.pub of the key you want authorized to connect that is contained in that file. BTW why all this as root for the ssh most configurations of it explicitly deny root access at all times in their configuration so you have to login as a normal user then su or sudo to use root. An edited example of an authorized_keys file.

Code:
:~$ cat .ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtCLVx0NqHKFl535p/JSfNqAsvK0oMzmHUi+ [snip..] IQQTI0EflbuwaOHhWpH+fIAHVhhbZJrUEsPCLnxiwpUsZUs3/1iwfjttwXKBZL1/xVe3yPfW0WOADDPhMQUWjTw+x0kynmQ== williamminer@Debian
 
1 members found this post helpful.
Old 04-13-2017, 12:53 PM   #3
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
The tutorial on setting up svn+ssh stated that that line should be added to the authorized_keys file before "ssh_rsa ...". I've never added a line like that to the authorized_keys file before, but my only experience with setting up ssh is for regular (non-svn) access, which I've always been able to do with no problem. I have ssh working now with another private key in my home .ssh directory. Honestly, I'm just clueless on how to setup the svn server to use svn+ssh, and I'm just trying to guess my way through based on internet tutorials. Any help would be much appreciated.

Regarding root: I created a user, username svn, to use to login to the svn server. I added to the svngroup and did not give it admin privileges. When I went to install the subversion server I logged in (to the actual console, not via ssh) as the svn user and just did su, so that I would have the privileges needed to do the install. Now that you mention it I think that was an error, because the .subversion config file is under /root home. I did chown all the files/folders in the repo to svn:svn though. What would have been the correct way to do it? Maybe I should remove it all and start again.

So I removed that first line from the authorized_keys file, and now the ssh connection is working with putty. Then I tried again:
Code:
# svn import acct svn+ssh:zdt_svn/occo_repo -m 'initial import'
(zdt_svn matches the name of the ssh connection that is setup and working in putty. I changed it in this post for security reasons though).
...And I got the same error message.

Last edited by rachaelw; 04-14-2017 at 03:14 PM.
 
Old 04-13-2017, 01:14 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
For the format of the authorized_keys file, see the manual page for sshd in the section "AUTHORIZED_KEYS FILE FORMAT" It will explain all the options for all the fields, including the optional options field that can appear at the beginning of a key.

Code:
man sshd
As suggested above, I would try the key without the constraints first.

Code:
ssh-rsa <redacted>= rsa-key-20170412
Then if that works, you can add the forced command to the optional options field.

Code:
command="/usr/sbin/svnserve -t -r /home/svn --tunnel-user=svn",no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty ssh-rsa <redacted>= rsa-key-20170412
Be sure that the absolute path to svnserve is correct.
 
1 members found this post helpful.
Old 04-13-2017, 01:46 PM   #5
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
The man sshd did help me understand the purpose of the authorized_keys options. I did find that I made a typo in the authorized_keys options and the absolute path to svnserve should have been /usr/bin/svnserve instead of /usr/sbin/svnserve. I am still stuck in the same spot though.

If I use the omit the options on the authorized keys file I can connect via putty, but when I try to connect via the svn import command I get the error message shown above. If I add the options line to the authorized_keys file then putty gives me the error message "Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex-with-mic)" and the svn import command gives me the same error message. I'm stuck in a loop on this one.

When the options are omitted and putty will connect correctly then why would svn import still not connect to the repository? Is there something else that I am missing?
 
Old 04-13-2017, 01:59 PM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Quote:
Originally Posted by rachaelw View Post
If I use the omit the options on the authorized keys file I can connect via putty, but when I try to connect via the svn import command I get the error message shown above. If I add the options line to the authorized_keys file then putty gives me the error message "Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex-with-mic)" and the svn import command gives me the same error message.
Ok. If you can connect without the options, then that shows the key is ok. Then it is a matter of figuring out what is wrong with the options. After that, you'll need to figure out which forced command svn needs.

About figuring out the options, add them back in one at a time and see if you can connect with PuTTY or whatever.

Code:
no-pty ssh-rsa <redacted>= rsa-key-20170412
Then

Code:
no-X11-forwarding,no-pty ssh-rsa <redacted>= rsa-key-20170412
and so on.
 
1 members found this post helpful.
Old 04-13-2017, 02:39 PM   #7
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thank you. That is a great way to troubleshoot it. I immediately found out that it is the user, svn, that is the problem. It connects under my other user correctly though, so now I am trying to troubleshoot that. Edit: I updated the sshd_config with some minor changes and restarted sshd and now that user, svn, can login with putty using the non-modified authorized_keys file.

I tried adding the options back to generated keys file one at a time. If I add any one of the options exactly as above it will no longer connect via putty. I receive the error message: server refused our key - Putty Fatal Error - Disconnected: No supported authentication methods available (server sent: ). It still connects with the other user though, because I specified the authorized keys file as %h/.ssh/authorized_keys and the other user's authorized_keys file was not modified. I tried restarting sshd as well. Is there something in the sshd config that needs to be changed to allow the use of these options or reference svn?

Last edited by rachaelw; 04-13-2017 at 05:24 PM.
 
Old 04-14-2017, 01:15 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
PuTTY will not connect because of the 'no-pty' option. If you temporarily change that to 'pty' then you will be able to connect and test the command="" part with PuTTY, I think.
 
1 members found this post helpful.
Old 04-14-2017, 10:53 AM   #9
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
I tried it with only the command="..." part and I can connect via PuTTY. Yay! It says:
Quote:
login as:svn
Authenticating with public key "rsa-key-20170411"
(success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revproprs dept h log-g\revprops atomic-revprops partial-replay inheritedc props ephermeral-txnprops file-revs-reverse ) ) )
Yet when I try the following I'm still getting the same error message I was before:
Code:
 svn $   cd /home/svn/repos/occo_repo
svn $   ls
acct conf db format hooks locks README.txt
svn $   svn import acct svn+ssh://svn@zdt_ssh/occo_repo -m 'initial import'
where zdt_ssh matches the name of the connection in putty. Could it be a syntax error? Or something with the subversion config I missed?

Last edited by rachaelw; 04-14-2017 at 10:55 AM.
 
Old 04-14-2017, 12:35 PM   #10
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
What is the URL for the guide you have been following?
 
1 members found this post helpful.
Old 04-14-2017, 01:03 PM   #11
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
I started with this one:
http://www.startupcto.com/server-tec...setting-up-svn
And then I used this one to configure the keys:
https://lebkowski.name/svn-key/

The session log from my first post is pretty much all the configuration I did.
 
Old 04-14-2017, 01:23 PM   #12
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
I took off the -q option in the .subversion config file located in /home/svn/.subversion and the error message now says:
Quote:
Could not resolve hostname zdt_ssh: Name or service not known
zdt_svn is the exact name of the connection I setup in PuTTY though. Was I supposed to add something to the /home/svn/.subversion/servers file for it?

Last edited by rachaelw; 04-14-2017 at 01:31 PM.
 
Old 04-14-2017, 02:07 PM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
The svn@zdt_ssh needs to refer to a real user on the remote system and a real host name or ip number for the remote system.
 
1 members found this post helpful.
Old 04-14-2017, 02:58 PM   #14
rachaelw
LQ Newbie
 
Registered: Apr 2017
Location: Southern California
Distribution: Fedora Server, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: Disabled
Please excuse my ignorance, but how does it then know where to find/use the private key if you are just referencing the hostname/ip?

Code:
svn import acct svn+ssh://svn@192.168.<REDACTED>/occo_repo -m 'initial import'
The authenticity of host '192.168..(192.168..)' can't be established.
ECDSA key fingerprint is SHA256:EQYX...
ECDSA key fingerprint is MD5:...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168..' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
svn: E170013: Unable to connect to a repository at URL 'svn+ssh://svn@192.168../occo_repo'
svn: E210002: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: E210002: Network connection closed unexpectedly
And thank you so much for your help. I would have been lost without it.

Last edited by rachaelw; 04-14-2017 at 03:07 PM. Reason: Add Information
 
Old 04-14-2017, 10:40 PM   #15
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,067
Blog Entries: 3

Rep: Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523Reputation: 2523
Quote:
Originally Posted by rachaelw View Post
but how does it then know where to find/use the private key if you are just referencing the hostname/ip?
The guide book is very, very weak in that area:
http://svnbook.red-bean.com/en/1.7/svn-book.html

It seems that svn+ssh:// reads settings you might have in ~/.ssh/config regarding keys or anything else. The gist is that you can set up a shortcut to point to the key and even set a user name for the SSH client to use.

Code:
Host mycode
        HostName 192.168.100.199
        User me
        IdentityFile /home/me/.ssh/key_mycode_rsa
Then you would be able to use the shortcut : svn co svn+ssh://mycode/occo_repo I think that way is probably best. YMMV.

Another way is to load the key into your SSH agent (ssh-agent, GNOME-keyring, etc.) and then let the keys get tried automatically. This works with 6 or fewer keys.

Code:
ssh-add /home/me/.ssh/key_mycode_rsa
Edit: you can also set options in ~/.subversion/config in the section [tunnels] for the SSH client, but they apply to all your SSH connections not just the one. Here are the defaults:

Code:
ssh = $SVN_SSH ssh -q -o ControlMaster=no
That or the first option might be useful in setting up multiplexing, if you are connecting to the server very frequently.

Last edited by Turbocapitalist; 04-14-2017 at 10:57 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pfx certification file to extract the RSA private/public key fantasy1215 Linux - Newbie 2 11-15-2011 02:51 AM
[SOLVED] SSH & RSA public key problems, works only for certain users? warwolf Linux - Networking 2 05-27-2011 06:17 AM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
need help with SSH private/public key taduser Linux - Security 2 04-02-2007 07:07 PM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration