Help:Putty
This page describes the use of PuTTY on windows for accessing Cloud VPS instances. If you are connecting to a Toolforge account, please see Help:Access to Toolforge instances with PuTTY and WinSCP.
Download the software
The download page is on https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html. Download PuTTY, Pageant and PuTTYGen. You can also download PSCP or PSFTP, if you want to transfer files from your computer to Cloud Services 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 “EdDSA SSH-2”, “255 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 Cloud Services from more than one computer.
- You should enter a passphrase to secure your key (twice). If you don't, your Cloud Services account could easily be compromised.
- Click “Save private key” and save your key to a location you remember.
- Upload the public key to idm.wikimedia.org.
See also https://the.earth.li/~sgtatham/putty/0.81/htmldoc/Chapter8.html#pubkey-puttygen.
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 “Cloud Services” (or anything you want to) into the text field labeled “Saved Sessions” and click “Save”.
See also https://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter4.html.
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 Cloud Services 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).
See also https://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter9.html.
Copying files from your computer to Cloud Services via the command line
Instead of a GUI tool like WinSCP, 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
pscp <file> [<file> …] <session>:
See also https://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter5.html.
PSFTP
psftp <session>
Available commands:
- 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.
See also http://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter6.html.
Moving your files from bastion to your instance
On bastion (PuTTY, not PSFTP), type:
scp * <instance>:[<path>] rm *