Home » Support » Index of All Documentation » Wing Pro Reference Manual » Project Manager » Remote Hosts »

SSH Setup Details

Pro Only

This guide will help you set up secure password-less SSH access to remote hosts that you want to use with Wing Pro. If you already know how to set up password-less SSH access to a remote system, the process is the same for Wing and you can skip this section.

Linux, OS X, and Windows with Cygwin or Git Bash

The necessary tools for SSH access are already installed on Linux and OS X systems. They are also included in Cygwin on Windows if the openssh package is selected at installation time, and they come with Git Bash, which is actually a scaled down version of Cygwin.

On these systems many developers already have an SSH key generated and in use. If you do not already have one, you will need to generate one with ssh-keygen as follows on the system where you will be running Wing Pro. On Windows, these commands need to be executed in the Cygwin or Git Bash terminal and not the Windows Console:

mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

Use the default settings and enter a password for encrypting the private key. Assuming default settings, this will produce ~/.ssh/id_rsa (private key file) and ~/.ssh/id_rsa.pub (public key file).

A copy of the public key needs to be transferred to the remote host you want to connect to and added to ~/.ssh/authorized_keys. The following is one way to accomplish this:

ssh username@remotehost "mkdir .ssh; chmod 700 .ssh"
ssh username@remotehost "sed -i -e '$a\' .ssh/authorized_keys"
scp ~/.ssh/id_rsa.pub username@remotehost:.ssh/pub.tmp
ssh username@remotehost "cat .ssh/pub.tmp >> .ssh/authorized_keys; rm .ssh/pub.tmp"

The first line above is only needed if you do not already have the directory ~./ssh on the remote system. The second line is only needed if you already have ~.ssh/authorized_keys on the remote system, to ensure that it ends in a newline so your added key is on its own line. The third and fourth lines transfer the public key to the remote host and add it as a key that is authorized to log in without entering a password.

Finally, run ssh-add on the host where the IDE is running, to add your newly created SSH key to the key chain manager. On OS X you can instead add your key to Keychain Access. In Cygwin need to first run ssh-agent bash and then ssh-add. In all of these, you will be prompted for the encryption password for the private key, if any.

Now you should be able to connect to the remote host without having to enter a password as follows:

ssh username@remotehost

If your remote server is running SSH on a non-default port (this is rare), then you will also need to edit your SSH configuration on the host where the IDE is running to set that port. This is done in ~/.ssh/config with an entry that looks like this:

host myhost.mydomain.com
   port 8022

Windows with Putty

An alternative to using Cygwin or Git Bash on Windows is to use PuTTY. This section describes how to set up SSH access with PuTTY.

If you don't already have it, download and install the complete suite of tools provided by PuTTY. You will need putty.exe, plink.exe, pscp.exe, and puttygen.exe.

If you don't already have an SSH key set up, you will need to generate one by running puttygen.exe, pressing the Generate button, providing the requested random input by moving your mouse over the blank area, entering and confirming a passphrase, and then saving both the public and private key files. The private key file is typically named id_rsa.ppk and the public key file is id_rsa.pub. Then paste the contents of the area labeled Public key for pasting into OpenSSH authorized_keys file into a file that you will transfer to the remote host to add it to ~/.ssh/authorized_keys. You can right-click to select all and then copy from the puttygen.exe window.

Assuming you saved the OpenSSH formatted public key to a file named openssh.pub you can install it on the remote host as follows:

plink username@remotehost "mkdir .ssh; chmod 700 .ssh"
plink username@remotehost "sed -i -e '$a\' .ssh/authorized_keys"
pscp openssh.pub username@remotehost:.ssh/pub.tmp
plink username@remotehost "cat .ssh/pub.tmp >> .ssh/authorized_keys; rm .ssh/pub.tmp"

The first line above is only needed if you do not already have the directory ~./ssh on the remote system. The second line is only needed if you already have ~.ssh/authorized_keys on the remote system, to ensure that it ends in a newline so your added key is on its own line. The third and fourth lines transfer the OpenSSH formatted public key to the remote host and add it as a key that is authorized to log in without entering a password.

Finally, run pageant.exe, right click on the small icon that appears in the lower right of your screen, select Add Key, and select your id_rsa.ppk private key file.

Note that you may need to restart pageant and load your key into it each time you restart Windows or log out and back in.

Now you should be able to connect to the remote host without having to enter a password as follows:

plink username@remotehost

If your remote server is running SSH on a non-default port (this is rare), then you will also need to edit your SSH configuration on the host where the IDE is running to set that port. This is done by running putty, entering a host name or ip address and the port number to use, and saving that host name as a saved session (all on the initial Session tab). Once this is done, any connection to that host name, also if made from the command line or Wing, will use the configured port.

SSH Setup Details