Changes between Version 18 and Version 19 of User Guide/Remote Access/SSH


Ignore:
Timestamp:
May 19, 2020, 9:06:49 PM (5 years ago)
Author:
msherman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • User Guide/Remote Access/SSH

    v18 v19  
    11[[Include(WikiToC)]]
    2 === SSH
    3 ==== Configuring SSH Keys ==== #ConfiguringSSHKeys
     2=== Configuring SSH Keys === #ConfiguringSSHKeys
    43
    54SSH access to [wiki:/Architecture/Domains COSMOS domains] 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:
     
    3231}}}
    3332
    34 ===== Generating keys
     33==== Generating keys
    3534 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]).
    3635
     
    5352
    5453[[BR]]
    55 ===== Uploading your public key to your COSMOS account
     54==== Uploading your public key to your COSMOS account
    5655 To upload you public key to your cosmos account, do the following:
    5756 1. Go to [https://wiki.cosmos-lab.org/cPanel/accountManagement/adminAuthKeys Profile] and sign in with your COSMOS username and password
     
    7473
    7574[[BR]]
    76 ===== Configuring your SSH client
     75==== Configuring your SSH client
    7776  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.
    7877 To test your setup, open a command-line terminal and (replacing ''your_cosmos_username'' with your own COSMOS username) type:
     
    8584
    8685[[BR]]
    87 ===== Common issues and how to solve them
     86==== Common issues and how to solve them
    8887 * If you receive a message like the following:
    8988{{{#!shell-session
     
    110109These instructions assume that you are using [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTY] as your SSH client.
    111110
    112 ===== Generating keys
     111==== Generating keys
    113112 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].
    114113
     
    146145
    147146[[BR]]
    148 ===== Uploading your public key to you COSMOS account
     147==== Uploading your public key to you COSMOS account
    149148 ''NOTE: Internet Explorer is not supported for Control Panel operations (including key upload)''
    150149
     
    169168
    170169[[BR]]
    171 ===== Configuring your SSH client
     170==== Configuring your SSH client
    172171
    173172 1. Open PuTTY.
     
    204203
    205204[[BR]]
    206 ===== Common issues and how to solve them
     205==== Common issues and how to solve them
    207206 * If you receive a message like the following:
    208207 {{{
     
    227226Mac OS has a native command line ssh client that can be used to remotely log into consoles. From the Finder select Applications -> Utilities -> Terminal to open a command line terminal.
    228227
    229 ===== Generating keys
     228==== Generating keys
    230229Generate the public and private keys using the following command
    231230{{{
     
    260259
    261260[[BR]]
    262 ===== Uploading your public key to you COSMOS account
     261==== Uploading your public key to you COSMOS account
    263262 To upload you public key to your cosmos account, do the following:
    264263 1. Go to [https://wiki.cosmos-lab.org/cPanel/accountManagement/adminAuthKeys Profile] and sign in with your COSMOS username and password
     
    281280
    282281[[BR]]
    283 ===== Configuring your SSH client
     282==== Configuring your SSH client
    284283 Under normal circumstances, as long as the private key file is located in the /Users/your_username/.ssh/ folder, the command line SSH client will use the correct key when connecting.
    285284
     
    294293
    295294[[BR]]
    296 ===== Common issues and how to solve them
     295==== Common issues and how to solve them
    297296 * TODO
    298297[[CollapsibleEnd]]
    299298
    300 [[BR]]
    301 
    302 ==== SSH Tunneling
    303 
    304 A common need is to connect to some resource on the testbed as if it were local. SSH provides this functionality. Go to the [wiki:tutorials/ssh_tunnel Configuring SSH Tunnels tutorial] to learn how to configure these.
    305  
    306 
    307 ==== Common SSH issues
    308 ===== If you deleted the "@internal1" key from your profile
    309 
    310 As long as you have at least one public key configured in your profile, use your SSH client to connect to {{{gw.orbit-lab.org}}} and run the following commands there. You do not need to make a reservation in the scheduler for this.
    311 
    312 {{{
    313 rm ~/.ssh/id_rsa
    314 rm ~/.ssh/id_rsa.pub
    315 ssh-keygen -t rsa -C "@internal1"
    316 }}}
    317 
    318 Press 'Enter' at every prompt so that the default filename (id_rsa) and no password is used.
    319 
    320 Then type the following command:
    321 
    322 {{{
    323 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
    324 }}}
    325 
    326 The internal key should now be restored.
    327 
    328 
    329 ===== Common ssh options for nodes
    330 
    331 We'd like to do a few things for convenience:
    332 
    333 1. log into nodes as root by default
    334 1. allow forwarding of X11 applications
    335 1. Suppress annoying host key warnings
    336 
    337 First, log into any console, or gw.orbit-lab.org
    338 
    339 After logging in, create or modify the file at {{{~/.ssh/config}}}
    340 
    341 Add the following to the file
    342 
    343 {{{
    344 Host sdr?-md* sdr?-s?-lg* srv?-co* srv?-lg* node?-* node??-*
    345   User root
    346   UserKnownHostsFile /dev/null
    347   StrictHostKeyChecking no
    348   ForwardX11 yes
    349 }}}
    350 
    351 * Host: The Host line matches common naming conventions for nodes within the testbed
    352 * User: root is set to match the common default for baseline
    353 * !UserKnownHostsFile: is set to /dev/null to prevent saving new host keys for nodes
    354 * !StrictHostKeyChecking: disables the warning message. SSH complains when host keys for a dns name change. This is a useful security feature, but is inconvenient within the testbed, where the operating system on a trusted machine changes frequently. Do not set it as a wildcard default for public endpoints, or you will be vulnerable to spoofing or man in the middle attacks.
    355 * ForwardX11: allows the forwarding of graphical applications running the X11 protocol from a node back to your machine
    356 
    357 
    358 
    359 
    360 
     299
     300
     301