| 1 | = Creating and using a public/private SSH keypair = |
| 2 | |
| 3 | (For accessing the [wiki:FgVirtualMachine RP3 virtual machine in the Cloud].) |
| 4 | |
| 5 | |
| 6 | == Creating a keypair on Linux or Mac OSX == |
| 7 | |
| 8 | 1. '''Generate a public/private keypair''' |
| 9 | |
| 10 | If you have files named `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub` you're fine. Proceed to step 2. |
| 11 | |
| 12 | If not, type the following command in `~/.ssh/` : |
| 13 | |
| 14 | {{{ |
| 15 | ssh-keygen -t rsa -C 'your@email.com' |
| 16 | }}} |
| 17 | |
| 18 | This will ask for a passphrase (twice). Although you could leave it empty, we advise to use a passphrase. See [https://help.github.com/articles/working-with-ssh-key-passphrases the instructions from GitHub] for more info. |
| 19 | |
| 20 | 2. '''Send your public key to the server maintainer''' |
| 21 | |
| 22 | Your '''public''' key is in the file `~/.ssh/id_rsa.pub`. Send it by email as an attachment. Proceed to step 3 after you got a confirmation. |
| 23 | |
| 24 | 3. '''Login to the VM''' |
| 25 | |
| 26 | For accessing the VM, you need your '''private''' key. It is in the file `~/.ssh/id_rsa` and you should never share it. SSH will automatically find it. |
| 27 | |
| 28 | To login to the VM, type the following command (you might be asked to type the passphrase for your private key): |
| 29 | |
| 30 | {{{ |
| 31 | ssh username@bios-vm.bbmrirp3-lumc.vm.surfsara.nl |
| 32 | }}} |
| 33 | |
| 34 | |
| 35 | == Creating a keypair on Windows == |
| 36 | |
| 37 | (Instructions borrowed from [http://wiki.joyent.com/wiki/display/jpc2/Manually+Generating+Your+SSH+Key+in+Windows Joyent].) |
| 38 | |
| 39 | [[Image(puttygengenerated2.png)]] |
| 40 | |
| 41 | 1. [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Download] and open the PuTTYgen program. |
| 42 | 2. For Type of key to generate, select SSH-2 RSA. |
| 43 | 3. Click the Generate button. |
| 44 | 4. Move your mouse in the area below the progress bar (note that moving the mouse is actually necessary, as it generates a amount of randomness in the keys). When the progress bar is full, PuTTYgen generates your key pair. |
| 45 | 5. Type a passphrase in the Key passphrase field. Type the same passphrase in the Confirm passphrase field. You can use a key without a passphrase, but this is not recommended. |
| 46 | 6. Click the Save private key button to save the private key. You must save the private key. You will need it to connect to your machine. |
| 47 | 7. Right-click in the text field labeled Public key for pasting into OpenSSH authorized_keys file and choose Select All. Right-click again in the same text field and choose Copy. |
| 48 | 8. Send an email to the server maintainer with copied content pasted into it. |
| 49 | |
| 50 | '''Note:''' This method did not seem to work reliably for all of us, so you might want to create a keypair on a Linux or Mac OSX machine instead and copy it to your Windows machine. |
| 51 | |
| 52 | |
| 53 | == Login to the VM from Windows using Putty == |
| 54 | |
| 55 | [[Image(putty1.png)]] |
| 56 | |
| 57 | 1. [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Download] and open the PuTTY program. |
| 58 | 2. Enter `bios-vm.bbmrirp3-lumc.vm.surfsara.nl` in the "Host Name" field. |
| 59 | 3. On the left, navigate to category "Connection/SSH/Auth". |
| 60 | 4. Click the "Browse" button and select your '''private''' key. |
| 61 | 5. Click the "Open" button to open the connection. |
| 62 | 6. First time, you will be asked to accept the server's signature (do so). |
| 63 | 7. You will be asked for your username. |
| 64 | |
| 65 | [wiki:FgConnectTroubleshooting#ConnectingviaPutty Troubleshooting] |
| 66 | |
| 67 | [[Image(putty2.png)]] |
| 68 | |
| 69 | == Login to the VM from Windows using !MobaXterm == |
| 70 | |
| 71 | [[Image(MobaXterm.png)]] |
| 72 | |
| 73 | |
| 74 | 1. [http://mobaxterm.mobatek.net/download.html Download], install and open !MobaXterm. |
| 75 | 2. Create a new session via Session -> New session. |
| 76 | 3. Enter `bios-vm.bbmrirp3-lumc.vm.surfsara.nl` in the "Remote host" field. |
| 77 | 4. Tick the Specify username box and fill in your VM username. |
| 78 | 5. Select the remote environment. For a terminal interface use interactive shell, or for a graphical desktop interface use Gnome desktop. |
| 79 | 6. Select your private key file. |
| 80 | 7. Start the session you just created. |
| 81 | |
| 82 | [wiki:FgConnectTroubleshooting#ConnectingviaMobaXterm Troubleshooting] |
| 83 | |
| 84 | == Login to the VM from Windows or Mac OSX using X2Go == |
| 85 | |
| 86 | [[Image(x2go.png)]] |
| 87 | |
| 88 | 1. [http://wiki.x2go.org/doku.php Download] and open the X2Go program. |
| 89 | 2. Create a new session (opened automatically, or via "Session" -> "New session"). |
| 90 | 3. Enter `bios-vm.bbmrirp3-lumc.vm.surfsara.nl` in the "Host" field. |
| 91 | 4. Enter your username in the "Login" field. |
| 92 | 5. Click the button next to the "Use RSA/DSA key for ssh connection" field and select your '''private''' key. |
| 93 | 6. Select "GNOME" as "Session type" and click the "OK" button. |
| 94 | 6. Open the session you just created. |
| 95 | 7. First time, you will be asked to accept the server's signature (do so). |
| 96 | |
| 97 | [wiki:FgConnectTroubleshooting#Connectingviax2go Troubleshooting] |