Oscar
HomeServicesDocumentation
  • Overview
  • Quickstart
  • Getting Started
  • System Hardware
  • Account Information
  • Short "How to" Videos
  • Quick Reference
    • Common Acronyms and Terms
    • Managing Modules
    • Common Linux Commands
  • Getting Help
    • ❓FAQ
  • Citing CCV
  • CCV Account Information
  • Student Accounts
  • Offboarding
  • Connecting to Oscar
    • SSH (Terminal)
      • SSH Key Login (Passwordless SSH)
        • Mac/Linux/Windows(PowerShell)
        • Windows(PuTTY)
      • SSH Configuration File
      • X-Forwarding
      • SSH Agent Forwarding
        • Mac/Linux
        • Windows (PuTTY)
      • Arbiter2
    • Open OnDemand
      • Using File Explorer on OOD
      • Web-based Terminal App
      • Interactive Apps on OOD
      • Using Python or Conda environments in the Jupyter App
      • Using RStudio
      • Desktop App (VNC)
    • SMB (Local Mount)
    • Remote IDE (VS Code)
      • From Non-compliant Networks (2-FA)
      • Setup virtual environment and debugger
  • Managing files
    • Oscar's Filesystem
    • Transferring Files to and from Oscar
    • Transferring Files between Oscar and Campus File Storage (Replicated and Non-Replicated)
    • Resolving quota issues
      • Understanding Disk Quotas
    • Inspecting Disk Usage (Ncdu)
    • Restoring Deleted Files
    • Best Practices for I/O
    • Version Control
  • Submitting jobs
    • Running Jobs
    • Slurm Partitions
    • Interactive Jobs
    • Batch Jobs
    • Managing Jobs
    • Job Arrays
    • MPI Jobs
    • Condo/Priority Jobs
    • Dependent Jobs
    • Associations & Quality of Service (QOS)
  • GPU Computing
    • GPUs on Oscar
      • Grace Hopper GH200 GPUs
      • H100 NVL Tensor Core GPUs
      • Ampere Architecture GPUs
    • Submitting GPU Jobs
    • Intro to CUDA
    • Compiling CUDA
    • Installing Frameworks (PyTorch, TensorFlow, Jax)
      • Installing JAX
      • Installing TensorFlow
    • Mixing MPI and CUDA
  • Large Memory Computing
    • Large Memory Nodes on Oscar
  • Software
    • Software on Oscar
    • Using Modules
    • Migration of MPI Apps to Slurm 22.05.7
    • Python on Oscar
    • Python in batch jobs
    • Installing Python Packages
    • Installing R Packages
    • Using CCMake
    • Intro to Parallel Programming
    • Anaconda
    • Conda and Mamba
    • DMTCP
    • Screen
    • VASP
    • Gaussian
    • IDL
    • MPI4PY
  • Jupyter Notebooks/Labs
    • Jupyter Notebooks on Oscar
    • Jupyter Labs on Oscar
    • Tunneling into Jupyter with Windows
  • Debugging
    • Arm Forge
      • Configuring Remote Launch
      • Setting Job Submission Settings
  • MATLAB
    • Matlab GUI
    • Matlab Batch Jobs
    • Improving Performance and Memory Management
    • Parallel Matlab
  • Visualization 🕶
    • ParaView Remote Rendering
  • Singularity Containers
    • Intro to Apptainer
    • Building Images
    • Running Images
    • Accessing Oscar Filesystem
      • Example Container (TensorFlow)
    • Singularity Tips and Tricks
  • Installing Software Packages Locally
    • Installing your own version of Quantum Espresso
    • Installing your own version of Qmcpack
  • dbGaP
    • dbGaP Architecture
    • dbGaP Data Transfers
    • dbGaP Job Submission
  • RHEL9 Migration
    • RHEL-9 Migration
    • LMOD - New Module System
    • Module Changes
    • Testing Jupyter Notebooks on RHEL9 mini-cluster
  • Large Language Models
    • Ollama
Powered by GitBook
On this page
  • SSH Config File Location
  • SSH Config File Structure Basics
  • Oscar Hosts
  • Connecting to your preconfigured host

Was this helpful?

Export as PDF
  1. Connecting to Oscar
  2. SSH (Terminal)

SSH Configuration File

How to save ssh configurations to a configuration file

PreviousWindows(PuTTY)NextX-Forwarding

Last updated 1 month ago

Was this helpful?

When regularly connecting to multiple remote systems over SSH, you’ll find that remembering all the hosts and various command-line options becomes tedious. OpenSSH allows setting up a configuration file to store different SSH options for each remote machine you connect t.

SSH Config File Location

OpenSSH client-side (in this case your personal computer) configuration file is named config, and it is stored in the hidded .sshdirectory under your user’s home directory (i.e., ~/.ssh)

When you use the command for the first time. The ~/.ssh directory is automatically created. If the directory doesn’t exist on your system, create it using the command below:

mkdir -p ~/.ssh && chmod 700 ~/.ssh

By default, the SSH configuration file may not exist, so you may need to create it using the :

touch ~/.ssh/config

This file must be readable and writable only by the user and not accessible by others:

chmod 600 ~/.ssh/config

SSH Config File Structure Basics

The SSH Config File takes the following structure:

Host hostname1
    SSH_OPTION value
    SSH_OPTION value

Host hostname2
    SSH_OPTION value

Host *
    SSH_OPTION value

The contents of the SSH config file is organized into sections. Each section starts with the Host directive and contains specific SSH options used when establishing a connection with the remote SSH server.

Oscar Hosts

Here we peovide a list of Oscar hosts and typical SSH configuration options. You have two options

  1. Copy the list of hosts below directly into your SSH Config File (i.e., ~/.ssh/config)

  2. Keep this content in a spearate file for Oscar hosts, lets say ~/.ssh/config.oscar and include that file in your main configuration file. In this case, the first line of ~/.ssh/config will be Include "~/.ssh/config.oscar"

# Oscar Hosts. Any hosts with the -campus suffix can be accessed
# only whithin Brown network i.e. campus or vpn
# Hosts without -campus sufix can be accessed from outside Brown
# but will requiere 2FA

# Hosts to connect to login nodes
Host oscar
    HostName ssh.ccv.brown.edu
    User <username>
    IdentityFile ~/.ssh/id_rsa
    ForwardAgent yes
    ForwardX11 yes
    TCPKeepAlive yes
    ServerAliveCountMax 20
    ServerAliveInterval 15
Host oscar-campus
    HostName sshcampus.ccv.brown.edu
    User <username>
    IdentityFile ~/.ssh/id_rsa
    ForwardAgent yes
    ForwardX11 yes
    TCPKeepAlive yes
    ServerAliveCountMax 20
    ServerAliveInterval 15
    
# When connecting from VSCODE use the following hosts
Host vscode-oscar-campus
    HostName oscar2
    User <username>
    ProxyCommand ssh -q -W %h:%p desktop-oscar-campus
Host vscode-oscar
    HostName oscar2
    User <username>
    ProxyCommand ssh -q -W %h:%p desktop-oscar

Connecting to your preconfigured host

You may now connect using the shortchut notation provided by your configuration file. That is, all you need to type is:

ssh oscar-campus

According to the configuration above, this is equivalent to

ssh -X -A -o TCPKeepAlive=yes -o ServerAliveCountMax=20 -o ServerAliveInterval=15 user@sshcampus.ccv.brown.edush

Much shorter. Enjoy!

Don't forget to replace <username> with your user. Also the configuration assumes your identity key is ~/.ssh/id_rsa - if you named it anything else, please update the value. If you need to generate a key got

ssh
touch command
here