Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 11 additions & 15 deletions ssh_keygen_config.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
# SSH keys and config file

Once you start computing you will be logging in to the CARC systems fairly often and having to type your username at the machine address will become tedious. In order to alleviate this tedium it is beneficial to generate ssh keys and a ssh config file. The ssh keys bypass the need to enter your password each time you log in, and the config file stores the addresses of all the machines you are logging in to.
Once you start computing, you will be logging in to the CARC systems fairly often, and having to type your username at the machine address will become tedious. In order to alleviate this tedium, it is beneficial to generate SSH keys and an SSH config file. The SSH keys bypass the need to enter your password each time you log in, and the config file stores the addresses of all the machines you are logging in to.

### SSH key generation
First, set up your ssh key. To do this type in the terminal prompt:
First, set up your SSH key. To do this, type in the terminal prompt:

```bash
ssh-keygen
```
Just keep hitting enter until the program finishes. We recommend that you decline setting up a passphrase as this defeats the convenience of having a SSH key. Now that your SSH key has been generated you need to copy it to your home directory at CARC. To do, open terminal and type:
Just keep hitting enter until the program finishes. We recommend that you decline setting up a passphrase, as this defeats the convenience of having an SSH key. Now that your SSH key has been generated, you need to copy it to your home directory at CARC. To do this, open a terminal and type:

```bash
ssh-copy-id yourusername@machinename.alliance.unm.edu
```
Since your home directory is shared across all machines at CARC you only need to do this step once to enable ssh key access across all CARC machines.
Since your home directory is shared across all machines at CARC, you only need to do this step once to enable SSH key access across all CARC machines.

### SSH config file
To make logging in to CARC even easier we also recommend setting up a ssh config file which allows you to simply type `ssh machinename` instead of your username at the machine address. To set up this file simply copy the example below and save it to a text document in your `ssh` folder, which is found at `~/.ssh/`. Change the user to your CARC username and you are set to log in quickly and efficiently. You can add machines based on which ones you have access to.
To make logging in to CARC even easier, we also recommend setting up an SSH config file, which allows you to simply type `ssh machinename` instead of your username at the machine address. To set up this file, simply copy the example below, change the user to your CARC username, and save it to a text document in your `ssh` folder, which is found at `~/.ssh/`. Save the File name as "config". If you are using Windows Notepad, change the Save type to "All files".
Now you are set to log in quickly and efficiently. You can add machines based on which ones you have access to.

```bash
Host wheeler
hostname wheeler-sn.alliance.unm.edu
Host easley
hostname easley-sn.alliance.unm.edu
user CHANGEME
port 22
Host galles
hostname galles.alliance.unm.edu
Host hopper
hostname hopper-sn.alliance.unm.edu
user CHANGEME
port 22
Host xena
hostname xena.alliance.unm.edu
user CHANGEME
ForwardX11 yes
port 22sa
```


*This quickbyte was validated on 6/24/2026*