我在使用TortoiseSVN 1.7.8訪問SVN存儲庫時遇到問題。TortiseSVN svn + ssh錯誤:無法連接到URL中的存儲庫...網絡連接意外關閉
SVN存儲庫位於CentOS 6.3盒子上,其中openssh 5.3p1:81.el6
似乎運行正常。
# svnadmin --version
# svnadmin, version 1.6.11 (r934486)
我可以從另一個CentOS的盒子用這個命令訪問知識庫:
svn list svn+ssh://[email protected]/var/svn/joetest
但是,當我試圖從一個Win 7的工作站,我不能這樣做瀏覽使用TortiseSVN的倉庫,所以使用以下路徑:
svn+ssh://[email protected]/var/svn/joetest
我收到以下錯誤在TortoiseSVN:
Unable to connect to a repository at URL 'svn+ssh://[email protected]/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
我可以使用Putty通過SSH從工作站登錄。
如果我以root身份嘗試訪問,結果是一樣的。
我給庫/var/svn/
的所有權USER:USER
跑
chmod 2700 -R /var/svn/
。
因爲我可以通過ssh從另一個Linux機器訪問存儲庫,所以權限似乎不成問題。
當我看使用tail -fn 2000 /var/log/secure
日誌文件,我每次看到TortiseSVN要求輸入密碼以下內容:
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
實際上,我能夠登錄,但會話,然後立即關閉。
它引起了我的注意,會話正在以USER (uid=0)
的身份打開,這可能是正確的,但如果它與問題有關,我會提及它。
我調查了修改svnserve.conf
,但據我所知,通過svn+ssh
訪問存儲庫時未使用,通過此方法爲每個日誌創建私有svnserve實例。從手冊:
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.
唯一的非默認設置在sshd_config
是:
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
有什麼想法?
只是一個想法,嘗試從URL中取出USER @並等待烏龜提示輸入憑證。不知道它是否會起作用,但值得一試。 – Scott
感謝您的建議,但結果相同。 – codewaggle
當你打開烏龜回購瀏覽器時,它給你什麼錯誤? – Scott