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 â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 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.
- Copy the public key to your preferences and click âSaveâ.
See also https://the.earth.li/~sgtatham/putty/0.62/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 *