This page describes the use of PuTTY on windows for accessing Labs instances.
Download the software
The download page is on http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html. Download PuTTY, Pageant and PuTTYGen. You can also download PSCP or PSFTP, if you want to transfer files from your computer to Labs directly (if you're not using a publicly accessible repository or a web server).
Generating a key pair
- Open PuTTYGen.exe and click “Generate”.
- Select “RSA SSH-2”, “2048 bits” and click “Generate”.
- Move your mouse randomly while the progress bar indicates that PuTTYGen is collecting randomness out of your mouse movements. Then wait for it to generate the key.
- You then can enter a comment (in the form of user@host) if you want access Labs from more than one computer.
- You should enter a passphrase to secure your key (twice). If you don't, your Labs account could easily be compromised.
- Click “Save private key” and save your key to a location you remember.
- Copy the public key to your preferences and click “Save”.
Setting up your session
- Open PuTTY and enter “bastion.wmflabs.org” into host name on the Session category (this is what you see when you open PuTTY)
- Open the category Connection → SSH → Auth, check “Allow agent forwarding” and specify your private key file in the according text field.
- Go back to the Session category, type “Labs” (or anything you want to) into the text field labeled “Saved Sessions” and click “Save”.
Connecting to your instance
- Open Pageant.
- Right-click on the Pageant tray icon (a computer wearing a hat) and click “Add key”. Select your private key file and click “Open”.
- Enter your passphrase.
- Open PuTTY and select your Labs session, click on “Load” and “Open”.
- Type “ssh <your-instance>”.
You can combine the last two steps if you write the mentioned command into the text field labeled “Remote command:” in the Connection → SSH category (don't forget to save your session).
Copying files from your computer to Labs via the command line
You can use PSCP or PSFTP. Both are run from the command line (type Win+R, “cmd” and hit return or look into the programs section of your start menu). Before you run, you have to ensure that you are in the directory where you have downloaded your executable.
pscp <file> [<file> …] <session>:
- lpwd to check if you are in the directory of the files you want to transfer.
- lcd to change your local working directory.
- put <file> to upload your file.
Moving your files from bastion to your instance
On bastion (PuTTY, not PSFTP), type:
scp * <instance>:[<path>] rm *