[[TOC(Documentation/bAccountManagement*, depth=2)]] == Configuring SSH Keys == SSH access to ORBIT machines requires the use of public key authentication. If you try to connect using the username and password that you use for accessing the scheduler and status pages, you will receive the following message: {{{ Permission denied (publickey). }}} You need to configure the SSH client on your computer to use a private key for connecting to ORBIT machines instead of a password. Additionally, the corresponding public key needs to be added to your ORBIT account. This page describes the procedure for generating a public/private key pair, configuring your SSH client, and uploading the necessary public key to your ORBIT account. The instructions here are for specific SSH client software, if you use a different SSH client than those referenced here, please follow the documentation provided with that SSH client and use the instructions here for reference. === Select the OS of your computer === [[CollapsibleStart(Linux)]] ''NOTE: These instructions are NOT for Ubuntu running on Windows using Windows Subsystem for Linux (WSL).'' 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: {{{ sudo apt-get update sudo apt-get install openssh-client }}} ==== Generating keys ==== 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]). To create your public and private SSH keys, open a command-line terminal and type: {{{ ssh-keygen -t rsa }}} 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 ORBIT account password. {{{ Generating public/private rsa key pair. Enter file in which to save the key (...): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in ... Your public key has been saved in ... Your public key is now available as .ssh/id_rsa.pub in your home folder. }}} 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. [[BR]] ==== Uploading your public key to your ORBIT account ==== To upload you public key to your orbit account, do the following: 1. Go to [https://www.orbit-lab.org/cPanel/controlPanel/start] and sign in with your ORBIT username and password 2. Click on "Change My Profile" option in the left side menu 3. Click the "Choose File" button next to "Public key file" 4. Navigate to where your '''public key file''' is stored (typically /home/your_username/.ssh) 5. Select the .pub file corresponding to the key you wish to use for ORBIT access 6. Click "Open" 7. Click the "Update Profile" button 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 ORBIT network. Please do NOT delete this key. [[Image(ControlPanel.jpg, width=700)]] [[BR]] ==== Configuring your SSH client ==== 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. To test your setup, open a command-line terminal and (replacing your_orbit_username with your ORBIT username) type: {{{ ssh your_orbit_username@gw.orbit-lab.org }}} You should be prompted to enter your key file passphrase and be able to successfully connect. [[BR]] ==== Common issues and how to solve them ==== * If you receive a message like the following: {{{ The authenticity of host 'gw.orbit-lab.org (128.6.192.134)' can't be established. ECDSA key fingerprint is SHA256:iLKtq2Z8wB3ADJdEyM1CwoU85gOeqIUyB4GOJ2YloQg. Are you sure you want to continue connecting (yes/no)? }}} 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. [[BR]] * If you receive a message like the following: {{{ Permission denied (publickey). }}} Try connecting again but manually specifying the location where your private SSH key is stored as in the following example: {{{ ssh -i /path_to_where_key_is_stored/private_ssh_key_name your_orbit_username@gw.orbit-lab.org }}} [[CollapsibleEnd]] [[BR]] [[CollapsibleStart(Windows)]] These instructions assume that you are using [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTY] as your SSH client. ==== Generating keys ==== In PuTTY, the key generation is handled by a separate program named ''puttygen.exe''. If you installed PuTTY via the installer, there should be an icon for PuTTYgen in your Start menu, otherwise [http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html download it from here]. 1. Open PuTTYgen 2. Click the "Generate" button and follow the instructions in the "Key" section of the window 3. Type a passphrase of your choice in the "Key passphrase" and "Confirm passphrase" fields. This passphrase does not have to be the same as your ORBIT account password. 4. Click the "Save private key" button 5. Save the private key file somewhere you will remember on your computer. Do not share this key with anyone! 6. After saving the private key file, right-click in the big text box labeled "Public key for pasting into OpenSSH authorized_keys file" 7. Click "Select All" from the popup menu to highlight the entire public key 8. Right-click again in the same big box and select "Copy" from the popup menu 9. Open Notepad from your Start menu 10. Paste what you just copied from PuTTYgen into Notepad. The contents should start with {{{ssh-rsa}}} and end with something like {{{rsa-key-20180621}}} 11. Save this file somewhere you will remember on your computer. This is your public key file. 12. Close PuTTYgen [[BR]] ==== Uploading your public key to you ORBIT account ==== ''NOTE:Internet Explorer is not supported for Control Panel operations (including key upload)'' To upload you public key to your orbit account, do the following: 1. Go to [https://www.orbit-lab.org/cPanel/controlPanel/start] and sign in with your ORBIT username and password 2. Click on "Change My Profile" option in the left side menu 3. Click the "Choose File" button next to "Public key file" 4. Navigate to where your '''public key file''' is stored (the file you saved with Notepad in the previous section) 5. Select the public key file you wish to use for ORBIT access 6. Click "Open" 7. Click the "Update Profile" button 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 ORBIT network. Please do NOT delete this key. [[Image(ControlPanel.jpg, width=700)]] [[BR]] ==== Configuring your SSH client ==== 1. Open PuTTY 2. || 4. || To connect to remote host by using newly minted keys configure your session in PuTTY: '''Load''' the session profile, go to Connection > SSH > Auth window and select the newly created private key; click '''Save''' to update session profile and then proceed to connect. If you didn't specify the passphrase in step 2, you won't be prompted for the password. || [[Image(PuTTYgen5.jpg, width=300)]] || [[BR]] ==== Common issues and how to solve them ==== * TODO [[CollapsibleEnd]] [[BR]] [[CollapsibleStart(Mac)]] '''Mac instrucstions are currently under development. We apologize for the inconvenience.''' ==== Generating keys ==== TODO [[BR]] ==== Uploading your public key to you ORBIT account ==== To upload you public key to your orbit account, do the following: 1. Go to [https://www.orbit-lab.org/cPanel/controlPanel/start] and sign in with your ORBIT username and password 2. Click on "Change My Profile" option in the left side menu 3. Click the "Choose File" button next to "Public key file" 4. Navigate to where your '''public key file''' is stored (typically /home/your_username/.ssh) 5. Select the .pub file corresponding to the key you wish to use for ORBIT access 6. Click "Open" 7. Click the "Update Profile" button 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 ORBIT network. Please do NOT delete this key. [[Image(ControlPanel.jpg, width=700)]] [[BR]] ==== Configuring your SSH client ==== TODO [[BR]] ==== Common issues and how to solve them ==== * TODO [[CollapsibleEnd]]