| 1 | [[Include(WikiToC)]] |
| 2 | |
| 3 | = Sig Comm 2022 Cosmos Testbed Tutorial = |
| 4 | |
| 5 | == Prerequisites == |
| 6 | If you are registered for the tutorial session and you are planning to participate in the live demos, please follow these instructions prior to the session. We will be unable to assist you with account setup during the tutorial session. |
| 7 | |
| 8 | === Create an Orbit Account === |
| 9 | 1. Register for a Cosmos / Orbit account here: [https://www.orbit-lab.org/userManagement/register]. For your organization, please select "ACM SIGCOMM 2022 TUTORIAL: COSMOS" from the drop-down menu. |
| 10 | 2. Look for a verification email with a link. After clicking the verification link, your account will be submitted to Cosmos administrators for approval. Account approval is not immediate, so please try to do this in advance of the tutorial. Please note that your account will not be approved unless you are registered for the tutorial. |
| 11 | |
| 12 | === Set up SSH keys === |
| 13 | |
| 14 | Access to the Cosmos testbed is typically through SSH, which requires the use of public key authentication. You will need to generate a public-private pair of keys and upload them to the account management page so that you can use your keys to log into Cosmos machines. You will also need to verify that you have an SSH client available on your personal machine. |
| 15 | |
| 16 | [[CollapsibleStart(Linux)]] |
| 17 | ''NOTE: These instructions are NOT for Ubuntu running on Windows using Windows Subsystem for Linux (WSL).'' |
| 18 | |
| 19 | These instructions assume you will be using a standard command-line SSH client for linux. If you have not already done so, ensure that you have it installed by running the following commands in a command-line terminal: |
| 20 | {{{#!shell |
| 21 | sudo apt-get update |
| 22 | sudo apt-get install openssh-client |
| 23 | }}} |
| 24 | |
| 25 | ==== Generating keys |
| 26 | Each distribution has their own location for the specific generation tools. These instructions are based on the documentation for Ubuntu ([https://help.ubuntu.com/community/SSH/OpenSSH/Keys located here]). |
| 27 | |
| 28 | To create your public and private SSH keys, open a command-line terminal and type: |
| 29 | {{{#!shell |
| 30 | ssh-keygen -t rsa |
| 31 | }}} |
| 32 | You will be prompted for a location to save the keys, and a passphrase for the keys which we highly recommend using. This passphrase does not have to be the same as your COSMOS account password. |
| 33 | {{{#!shell-session |
| 34 | Generating public/private rsa key pair. |
| 35 | Enter file in which to save the key (...): |
| 36 | Enter passphrase (empty for no passphrase): |
| 37 | Enter same passphrase again: |
| 38 | Your identification has been saved in ... |
| 39 | Your public key has been saved in ... |
| 40 | Your public key is now available as .ssh/id_rsa.pub in your home folder. |
| 41 | }}} |
| 42 | |
| 43 | This process will generate and store a private key and a public key file. The private key will be stored in the file and location you specify when prompted, and the public key file will be named the same as your private key file but with a .pub extension. |
| 44 | |
| 45 | [[BR]] |
| 46 | ==== Uploading your public key to your COSMOS account |
| 47 | To upload you public key to your cosmos account, do the following: |
| 48 | 1. Go to [https://wiki.cosmos-lab.org/cPanel/accountManagement/adminAuthKeys Profile] and sign in with your COSMOS username and password |
| 49 | |
| 50 | 2. Click on "Change My Profile" option in the left side menu |
| 51 | |
| 52 | 3. Click the "Choose File" button next to "Public key file" |
| 53 | |
| 54 | 4. Navigate to where your '''public key file''' is stored (typically /home/your_username/.ssh) |
| 55 | |
| 56 | 5. Select the .pub file corresponding to the key you wish to use for COSMOS access |
| 57 | |
| 58 | 6. Click "Open" |
| 59 | |
| 60 | 7. Click the "Update Profile" button |
| 61 | |
| 62 | As a side note, expect to see a default auto generated public key in the list (ends with @internal1). This is used for SSH access between machines inside the COSMOS network. Please do NOT delete this key. |
| 63 | |
| 64 | [[Image(wiki:UserGuide/RemoteAccess/SSH:ControlPanel.jpg, width=700)]] |
| 65 | |
| 66 | [[BR]] |
| 67 | ==== Configuring your SSH client |
| 68 | Under normal circumstances, as long as the private key file is located in the /home/your_username/.ssh/ folder, the command line SSH client will use the correct key when connecting. |
| 69 | To test your setup, open a command-line terminal and (replacing ''your_cosmos_username'' with your own COSMOS username) type: |
| 70 | {{{#!shell-session |
| 71 | ssh your_cosmos_username@gw.orbit-lab.org |
| 72 | }}} |
| 73 | You should be prompted to enter your key file passphrase and be able to successfully connect. |
| 74 | |
| 75 | Type {{{exit}}} and press the Enter key to end the SSH session. |
| 76 | |
| 77 | [[BR]] |
| 78 | ==== Common issues and how to solve them |
| 79 | * If you receive a message like the following: |
| 80 | {{{#!shell-session |
| 81 | The authenticity of host 'gw.orbit-lab.org (128.6.192.134)' can't be established. |
| 82 | ECDSA key fingerprint is SHA256:iLKtq2Z8wB3ADJdEyM1CwoU85gOeqIUyB4GOJ2YloQg. |
| 83 | Are you sure you want to continue connecting (yes/no)? |
| 84 | }}} |
| 85 | This is a normal message that occurs when your computer connects via SSH to another that it has never connected to before or if the "fingerprint" of the other machine changed (due to replacement or reconfiguration). Simply type {{{yes}}} and connection will proceed normally. |
| 86 | [[BR]] |
| 87 | * If you receive a message like the following: |
| 88 | {{{#!shell-session |
| 89 | Permission denied (publickey). |
| 90 | }}} |
| 91 | Try connecting again but manually specifying the location where your private SSH key is stored as in the following example: |
| 92 | {{{#!shell-session |
| 93 | ssh -i /path_to_where_key_is_stored/private_ssh_key_name your_cosmos_username@gw.orbit-lab.org |
| 94 | }}} |
| 95 | |
| 96 | [[CollapsibleEnd]] |
| 97 | |
| 98 | [[BR]] |