FaqSubversionSSH
How Do I Set Up SSH with Subversion?
Subversion with the svn+ssh:// access method type is one of the protocols supported in NetBeans that calls for valid settings in the subversion config file. This file is located at:
- Windows systems: %APPDATA%\Subversion\config
- Unix systems, including Macintosh: $HOME/.subversion/config>
Open this file and edit the tunnels section:
- Windows:
# with the use of private key authentication ssh = $SVN_SSH plink.exe -l <username> -i D:/new_my_private_key.ppk # or with password authentication ssh = $SVN_SSH plink.exe -l <username> -pw password
Putty applications can be downloaded as binaries from the following page: http://www.chiark.greenend.org.uk/sgtatham/putty/download.html
Note: Using plink with NetBeans might be annoying due command prompt window pop-up every time you use subversion functions. You may try TortoisePlink.exe from TortoiseSVN to address the issue. TortoisePlink.exe accepts the same options as plink.exe.
- Unix-like systems:
ssh = $SVN_SSH ssh -q -l <username> -i identy_file
NOTE that your ssh tunnel command has be specified with the -q switch in case your ssh server is configured to return a banner.
SSH password-caching tools can help if SSH is repeatedly asking for the password. SSH password-caching tools include Pageant (as a part of Putty applications) on Windows and ssh-agent on Unix-like systems. If a key was generated along with the PassPhrase, you have to use the "ssh password-caching" tool.
- Windows:
- Modify the tunnels section of the Subversion config file:
ssh = $SVN_SSH plink -l <username>
- Download and start the Pageant tool. (It is displayed in the system tray).
- Open it and add the key. You will be prompted for the PassPhrase.
- Unix-like systems:
- Modify the tunnels section of the subversion config file: //
ssh = $SVN_SSH ssh -l <username>
- Start an ssh agent (use -c for C-shell and -s for Bourne shell env variables) and add your identity:
ssh-agent [[S| -c]] | head -2 > ~/.agent source ~/.agent ssh-add path_to_indentity_file
- Note: this can be done as an alias (e.g., in a .cshrc) and with an associated source command agent only has to be run once per boot (or ssh-agent shutdown). In ~/.cshrc:
alias agent 'ssh-agent | head -2 > ~/.agent; source ~/.agent;ssh-add'source ~/.agent
- Start NetBeans IDE either
- from the same terminal.
- or from a wrapper script (e.g., for panel buttons)
====/bin/csh==== source ~/.agent /usr/local/netbeans-6.0.1/bin/netbeans &
Tunneling SSH through a Proxy:
This section describes how to tunnel through an http-proxy server without any server-side modifications.
- Windows:
- Start Putty application.
- Select the Connection | Proxy item. Set required Proxy type and fill Proxy hostname, Port. (If the proxy server asks for authentication, fill in a valid Username and Password)
- Now select Session item again and enter the session name into Saved Sessions field. (session name must match the hostname of the subversion repository. For example: for the Repository URL https://peterp.org/svnrepo the session name has to be peterp.org)
- Save the session.
- Unix-like systems:
- Download and extract corkscrew.
- In the corkscrew directory type: ./configure, make and make install
- Add a new line to your ~/.ssh/config
#replace the http proxy and port settings with the correct values ProxyCommand /usr/local/bin/corkscrew proxy.example.com 8080 %h %p
