Changes between Version 18 and Version 19 of User Guide/Remote Access/SSH
- Timestamp:
- May 19, 2020, 9:06:49 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
User Guide/Remote Access/SSH
v18 v19 1 1 [[Include(WikiToC)]] 2 === SSH 3 ==== Configuring SSH Keys ==== #ConfiguringSSHKeys 2 === Configuring SSH Keys === #ConfiguringSSHKeys 4 3 5 4 SSH 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: … … 32 31 }}} 33 32 34 ==== =Generating keys33 ==== Generating keys 35 34 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]). 36 35 … … 53 52 54 53 [[BR]] 55 ==== =Uploading your public key to your COSMOS account54 ==== Uploading your public key to your COSMOS account 56 55 To upload you public key to your cosmos account, do the following: 57 56 1. Go to [https://wiki.cosmos-lab.org/cPanel/accountManagement/adminAuthKeys Profile] and sign in with your COSMOS username and password … … 74 73 75 74 [[BR]] 76 ==== =Configuring your SSH client75 ==== Configuring your SSH client 77 76 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. 78 77 To test your setup, open a command-line terminal and (replacing ''your_cosmos_username'' with your own COSMOS username) type: … … 85 84 86 85 [[BR]] 87 ==== =Common issues and how to solve them86 ==== Common issues and how to solve them 88 87 * If you receive a message like the following: 89 88 {{{#!shell-session … … 110 109 These instructions assume that you are using [https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html PuTTY] as your SSH client. 111 110 112 ==== =Generating keys111 ==== Generating keys 113 112 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]. 114 113 … … 146 145 147 146 [[BR]] 148 ==== =Uploading your public key to you COSMOS account147 ==== Uploading your public key to you COSMOS account 149 148 ''NOTE: Internet Explorer is not supported for Control Panel operations (including key upload)'' 150 149 … … 169 168 170 169 [[BR]] 171 ==== =Configuring your SSH client170 ==== Configuring your SSH client 172 171 173 172 1. Open PuTTY. … … 204 203 205 204 [[BR]] 206 ==== =Common issues and how to solve them205 ==== Common issues and how to solve them 207 206 * If you receive a message like the following: 208 207 {{{ … … 227 226 Mac 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. 228 227 229 ==== =Generating keys228 ==== Generating keys 230 229 Generate the public and private keys using the following command 231 230 {{{ … … 260 259 261 260 [[BR]] 262 ==== =Uploading your public key to you COSMOS account261 ==== Uploading your public key to you COSMOS account 263 262 To upload you public key to your cosmos account, do the following: 264 263 1. Go to [https://wiki.cosmos-lab.org/cPanel/accountManagement/adminAuthKeys Profile] and sign in with your COSMOS username and password … … 281 280 282 281 [[BR]] 283 ==== =Configuring your SSH client282 ==== Configuring your SSH client 284 283 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. 285 284 … … 294 293 295 294 [[BR]] 296 ==== =Common issues and how to solve them295 ==== Common issues and how to solve them 297 296 * TODO 298 297 [[CollapsibleEnd]] 299 298 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