You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
Help:Putty: Difference between revisions
m (remove penetrant advertisements)
(Redirect users connecting to toolforge)
|Line 1:||Line 1:|
This page describes the use of PuTTY on windows for accessing
This page describes the use of PuTTY on windows for accessing instances.
== Download the software ==
== Download the software ==
Revision as of 23:14, 8 February 2018
Wikimedia Cloud documentationThis is a documentation page for Wikimedia Cloud. If you can improve it, please do that. You can also request help on #wikimedia-cloud connect. For all documentation pages, please see the List of all documentation pages for Wikimedia Cloud. If you are seeking a help with a specific project, please contact the project owners.
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 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 *