1. Home
  2. Docs
  3. General Computing Environ...
  4. SSH
  5. Configuration Examples

Configuration Examples

Important: For all of the below examples, you must change the following keywords from the example:

argonneusername becomes your actual Argonne username.

targetusername becomes your username on the specific system in question (may not be your Argonne username)

ssh_key_location becomes the path to the SSH key you wish to use (eg. ~/.ssh/id_rsa or ~/.ssh/id_ed25519)

If you named your SSH key anything other than the default, you’ll need to specify that in the configuration.

For the examples in the below table, please make sure your .ssh/config file has the following defined already:

Host login-gce
  Hostname logins.cels.anl.gov
  user argonneusername
  IdentityFile ssh_key_location

If you don’t have this defined, the examples below may not work.  The above section is mandatory.

The next section is optional but recommended to be at the top of the file:

ForwardAgent yes
ServerAliveInterval 60

Putting that section in will reduce the number of dropped connection you may experience, as well as reduce the number of times you’ll need to type your passphrase or a password.  If you’re using an ssh agent, you’ll want your keys added to that agent.  Each OS has its own way of doing this, however “ssh-add /path/to/private_key” should work.  You can see what keys are in your agent with ssh-add -l.

In the examples below, the optional ForwardX11Trusted is used.  You can omit that if you do not want to forward X11 connections.  Note if you do, only “ForwardX11Trusted” will work, and not “ForwardX11”.

[table id=3 /]