Configure Subversion with SSH in Dreamweaver

Configure password-less SSH access

Before you configure Subversion or Dreamweaver for SVN+SSH, create an RSA key pair and configure the public key on the server. This public/private key pair is used to authenticate with the server, instead of storing and passing your password in plain text. (It is possible to configure SSH without using key pairs; however, Adobe doesn't recommend doing so because of the lack of security.)

To configure the RSA keys, create the private/public RSA key pair on the client computer. Put the public key on the server, and then authorize the key on the server. Adobe also recommends testing the SSH connection afterward to verify that it is configured correctly.

Note: Access to the client computer (that is, the one from which you connect) is required to complete these steps. These steps also require access to the server (for example, directly or via SSH/FTP). On Windows, you need access to an SSH client (for example, TortoiseSVN) and an RSA key generator application (for example PuTTYgen). Mac OS comes with an SSH client and a key generator.

Create RSA keys on Mac OS

Complete these steps on the client computer:

  1. Open a Terminal window.
  2. Input the following command and then press Enter:

    ssh-keygen -t rsa

  3. When prompted to save the key, press Enter to select the default location.
  4. (Optional) Type a passphrase for the key, then press Return/Enter. If you typed a passphrase, then type it again to confirm and press Return/Enter.

    A confirmation message appears showing that the private and public keys were saved, including their save location and names.

  5. To copy the public key to the server, input a command like the following, substituting the appropriate AccountName and ServerName:

    scp .ssh/id_rsa.pub AccountName@ServerName:~/temp_rsa.pub

  6. Connect to the server via SSH. Input a command like the following, substituting the appropriate AccountName and ServerName:

    ssh -l AccountName@ServerName

  7. Type your password when prompted to log in.

    Note: If you can log in without being prompted for your password, then your computer/login has already been authorized on the server. Skip the next section and go directly to Test the SSH connection, below.

Create RSA keys on Windows

Complete these steps on the client computer:

  1. Open your RSA key generator application (for example, PuTTYgen).
  2. Generate an RSA key pair.
  3. Save the private key and the public key. The remaining steps assume that you used the names private_key and public_key, respectively.
  4. Put your public_key in ~/ using the name temp_rsa.pub on your server (for example, directly or via SSH/FTP).
  5. Connect to the server via SSH. Assuming that you're using TortoiseSVN, input a command like the following, substituting the appropriate AccountName and ServerName:

    tortoiseplink AccountName@ServerName

  6. Type your password when prompted to log in.

    Note: If you can log in without being prompted for your password, then your computer/login has already been authorized on the server. Skip the next section and go directly to Test the SSH connection, below.

Configure the key on the server

On the server (for example, directly or via SSH/FTP), complete the following steps:

  1. Verify that the .ssh folder exists on the server. Input the following command and then press Enter:

    ls -al ~/.ssh

  2. Do one of the following:

    • If the results of the ls command indicate that the folder does not exist, then create it and then authorize the key on the server. Input the following commands, and press Enter after each one:

      mkdir ~/.ssh
       
      mv ~/temp_rsa.pub ~/.ssh/authorized_keys
       
    • If the folder exists, then add the key to the server's authorization list. Input the following commands, and press Enter after each one:

      cat ~/.ssh/authorized_keys ~/temp_rsa.pub > temp_keys
       
      mv temp_keys ~/.ssh/authorized_keys

Test the SSH connection

Once you have completed the steps above, test to make sure you can connect to your server via SSH without being prompted for a password.

If you can connect but are still being prompted for a password, repeat the applicable server-side steps above. Consider starting over by creating a key pair on the client, and then repeating the remaining steps.

Note: When generating keys, be sure to specify the correct number of bits for your server. 2048 bits is fairly common. However, check with your web host if you are not certain.

If you still can't connect without being prompted for a password, see the OpenSSH or your web host for additional assistance.

Configure Subversion to use SSH

To configure Subversion to use SSH, add the path to your SSH client and your login information to the Subversion config file.

Note: This information assumes that Windows users are using TortoiseSVN, and that Mac users are using the Mac OS SSH client.

Locations of Subversion config file

To complete these steps, first open the Subversion configuration file for editing. The config file is in one of the following folders:

  • Windows 7 and Vista

    C:\Users\Your User Name\AppData\Roaming\Subversion\config
  • Windows XP

    C:\Documents and Settings\Your User Name\Application Data\Subversion\config
  • Mac OS X

    /Users/Your User Name/.subversion/config

Configure Subversion for Mac OS

  1. In the Terminal, locate the .subversion folder in your user folder as mentioned above. (Choose Go > Go To Folder in Finder, or use a command like ls -al ~/.subversion in Terminal.)
  2. The path to SSH is usually "/usr/bin/ssh". If you are not sure, enter which ssh into Terminal.
  3. Open the Subversion config file for editing with a text editor (for example, nano, pico, and so on).

    For example, enter nano ~/.subversion/config into Terminal.
  4. Enter the following within the tunnels section (underneath [tunnels]):

    ssh = $SVN_SSH /usr/bin/ssh

    Note: To use key-based authentication, add -i PathToKey. E.g. ssh = $SVN_SSH /usr/bin/ssh -i PathToKey

    Alternatively, you can enter the user name and password into this path by adding -l UserName -pw Password. This method is insecure and, therefore, Adobe doesn't recommend it.
  5. Save and close the config file.

Configure Subversion for Windows

  1. In Windows Explorer, locate the Subversion folder in your user folder as mentioned above.
  2. Open the file into a plain-text editor, like Notepad.
  3. In the [tunnels] section, specify where ssh client exists. This location depends on where you installed it.

    Open the file and enter the following within the tunnels section (underneath [tunnels]):

    ssh = $SVN_SSH C:/PathToSSHClient/tortoiseplink.exe

    Note: To use key-based authentication, add -i PathToKey. E.g. ssh = $SVN_SSH C:/PathToSSHClient/tortoiseplink.exe -i PathToKey

    Alternatively, you can enter the user name and password into this path by adding -l UserName -pw Password. This mthod is insecure and, therefore, Adobe doesn't recommend it.
  4. Save and close the config file.

Set your site to use Subversion with SSH

  1. Open your Dreamweaver site definition, and then choose Version Control from the category list.
  2. Select Subversion from the Access menu.
  3. Select SVN+SSH for the Protocol.
  4. Enter your server address in the Server Address field.
  5. Unless included with in your server address, enter your repository path in the Repository Path field.
  6. Dreamweaver CS4 only:
    1. If your server does not use the default SSH port (22), then select Non Default and then enter the Server Port.
    2. Enter the Username and Password. Leave these fields empty for anonymous login.

      Note: The user name and password are NOT taken from Dreamweaver. The only way to send user is to enter AccountName@ServerName in the server name field.
  7. Click the Test button to test the connection.

  8. Close the Site Definition dialog box.
  9. In the Files panel, choose Local view or Repository view.
  10. Right-click (Windows) or Ctrl+click (Mac OS) on the root folder to display the menu.

  11. Select Version Control > Get Latest Versions to update the file list.

Get help faster and easier

New user?