title: TortiseSVN svn+ssh Error: Unable to connect to a repository at URL ... Network connection closed unexpectedly
body: <p>I'm having problems accessing an SVN repository using TortoiseSVN 1.7.8.</p>
  
  <p>The SVN repository is on a CentOS 6.3 box with <code>openssh 5.3p1:81.el6</code> and appears to be functioning correctly.</p>
  
  <pre><code># svnadmin --version
  # svnadmin, version 1.6.11 (r934486)
  </code></pre>
  
  <p>I can access the repository from another CentOS box with this command:</p>
  
  <pre><code>svn list svn+ssh://USER@xxx.xx.xx.xxx/var/svn/joetest
  </code></pre>
  
  <p>But when I attempt to browse the repository using TortiseSVN from a Win 7 workstation I'm unable to do so using the following path:</p>
  
  <pre><code>svn+ssh://USER@xxx.xx.xx.xxx/var/svn/joetest
  </code></pre>
  
  <p>I receive the following error from TortoiseSVN:</p>
  
  <blockquote>
    <p>Unable to connect to a repository at URL
    'svn+ssh://USER@xxx.xx.xx.xxx/var/svn/joetest' To better debug SSH
    connection problems, remove the -q option from 'ssh' in the [tunnels]
    section of your Subversion configuration file. Network connection
    closed unexpectedly</p>
  </blockquote>
  
  <p>I'm able to login via SSH from the workstation using Putty.</p>
  
  <p>The results are the same if I attempt access as root.</p>
  
  <p>I've given ownership of the repository <code>/var/svn/</code> to <code>USER:USER</code> and ran<br />
  <code>chmod 2700 -R /var/svn/</code>. </p>
  
  <p>Because I can access the repository via ssh from another Linux box, permissions don't appear to be the problem.</p>
  
  <p>When I watch the log file using <code>tail -fn 2000 /var/log/secure</code>, I see the following each time TortiseSVN asks for the password:</p>
  
  <pre><code>Sep 26 17:34:31 dev sshd[30361]: Accepted password for USER from xx.xxx.xx.xxx port 59101 ssh2
  Sep 26 17:34:31 dev sshd[30361]: pam_unix(sshd:session): session opened for user USER by (uid=0)
  Sep 26 17:34:31 dev sshd[30361]: pam_unix(sshd:session): session closed for user USER
  </code></pre>
  
  <p>I'm actually able to login, but the session is then closed immediately.</p>
  
  <p>It caught my eye that the session is being opened for USER by root <code>(uid=0)</code>, which may be correct, but I'll mention it in case it has something to do with the problem.</p>
  
  <p>I looked into modifying the <code>svnserve.conf</code>, but as far as I can tell, it's not used when accessing the repository via <code>svn+ssh</code>, a private svnserve instance is created for each log in via this method. From the manual:</p>
  
  <blockquote>
    <p>There's still a third way to invoke svnserve, and that's in “tunnel
    mode”, with the -t option. This mode assumes that a remote-service
    program such as RSH or SSH has successfully authenticated a user and
    is now invoking a private svnserve process as that user. The svnserve
    program behaves normally (communicating via stdin and stdout), and
    assumes that the traffic is being automatically redirected over some
    sort of tunnel back to the client. When svnserve is invoked by a
    tunnel agent like this, be sure that the authenticated user has full
    read and write access to the repository database files. (See Servers
    and Permissions: A Word of Warning.) It's essentially the same as a
    local user accessing the repository via file:/// URLs.</p>
  </blockquote>
  
  <p>The only non-default settings in <code>sshd_config</code> are:</p>
  
  <pre><code>Protocol 2 # to disable Protocol 1
  
  SyslogFacility AUTHPRIV
  
  ChallengeResponseAuthentication no
  
  GSSAPIAuthentication yes
  GSSAPICleanupCredentials yes
  
  UsePAM yes
  
  AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
  AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
  AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
  AcceptEnv XMODIFIERS
  
  X11Forwarding no
  
  Subsystem       sftp    /usr/libexec/openssh/sftp-server
  </code></pre>
  
  <p>Any thoughts?</p>