SSH Connection
The most traditional method of connecting to Unity is using an SSH connection. SSH stands for “secure shell”. A shell is the terminal, or Command Line Interface (CLI), that you type commands into. The most common shell in Linux is bash, which is most likely what you will be using in Unity.
This guide will show you how to generate your SSH keys, store your SSH keys in the correct location, and use them to connect to Unity through either the Command Line Interface (CLI) or PuTTy for Windows users.
Part 1: Generate SSH Keys
The authentication method we use for SSH connections is with public/private RSA keys. You can read more about the public/private key exchange here.
There is a public SSH key that is stored on the server, and a private SSH key that you keep on your local computer. Think of them like your name and your social security number, respectively. In order to login to Unity, you need to authenticate the public key with your private key.
Use the following instructions to generate and save your public key on Unity:
- Go to Account Settings in Unity in Unity.
- Under SSH Keys, click the Generate Key icon, or ’+’. The public key is added to our database, and the private key downloads to your computer.
Part 2: Store SSH Private Key
Once you have generated your public and private keys, move the downloaded private key into your home
directory’s .ssh
folder. The .ssh
folder path name is:
C:/Users/YOUR_NAME/.ssh
in Windows/home/YOUR_NAME/.ssh
in Linux/Users/YOUR_NAME
in Mac
In the terminal, a shortcut for this directory is the ~
symbol.
To move the private key to the appropriate directory, use the following command:
mv ~/Downloads/privkey.key ~/.ssh/unity-privkey.key
This command works for any operating system since it uses the
~
symbol as the directory shortcut.Linux and Mac users: use the following command to change the permissions on the file due to its importance to security.
chmod 600 ~/.ssh/unity-privkey.key
Recommended: add a password to this file using the following command.
ssh-keygen -p -f ~/.ssh/unity-privkey.rsa
Part 3: Connect to Unity with SSH connection
The following instructions will show you how to connect to Unity using the SSH keys that you generated and stored. There are two different methods outlined below:
Option A: CLI users can connect to Unity through the terminal, or Command Line Interface (CLI), on any operating system. This option is the recommended method.
Option B: Windows users can also use PuTTy to connect to Unity.
For both methods, you will need the following information about your Unity account:
- Hostname/Address:
unity.rc.umass.edu
- Username:
NETID_school_edu
<organization username>_<organization>_edu
.
View your username here.Option A: Connect to Unity using the CLI
We recommend connecting to Unity through the CLI, or terminal. Windows, Mac, and most distributions of Linux come with the OpenSSH client, which you can use to connect to Unity in your terminal. The following sections include instructions on how to connect to Unity in your terminal using the SSH connection established in Part 1: Generate SSH keys and Part 2: Store SSH private key.
First, make sure that the OpenSSH config file exists and contains the correct information using the following steps:
- If the file
~/.ssh/config
doesn’t exist, create it. - Copy the following contents to your Notepad if it is not already there:
Host unity HostName unity.rc.umass.edu User <USERID>_<ORGANIZATION>_edu IdentityFile <PATH_TO_PRIVATE_KEY>
- Replace
<NETID>
and<PATH_TO_PRIVATE_KEY>
to your specifications. - Save the file in a directory of your choosing, without an extension.
Move and rename the OpenSSH config file
You may need to move and rename the config file, which can be challenging since the user-friendly methods are less cooperative with files that don’t have an extension, and the ssh config file cannot have an extension. The most reliable way to rename or move your OpenSSH config file to the correct location is to use the mv
command, as demonstrated in the instructions below.
- Windows Notepad adds the
.txt
extension even if you choose the ‘All Files’ option when saving. - Mac TextEdit doesn’t include the option to save a file as
.txt
. To make your current file plain-text formatted, use⌘-⇧-T
. Then, you can add plain-text as a ‘Save as’ option in the config.
To move your OpenSSH config file to the correct location with the mv
command, use the following instructions:
Open your terminal.
To move and rename the Open SSH config file successfully, use the
mv
(move) command as shown in the following example:mv path/to/source-file path/to/desination-file
With the source and destination file paths filled in, the command might look something like this:
mv ~/Desktop/ssh-config.txt ~/.ssh/config
The
mv ~/Desktop/ssh-config.txt ~/.ssh/config
example above assumes that the SSH config file is in the Desktop folder, and needs to be moved and renamed to~/.ssh/config
.
Connect to Unity in the terminal
Once the OpenSSH config file contains the information for Unity and is in the correct location, you can connect to Unity through the terminal using the following instructions:
- To begin connecting, type the command
ssh unity
into your terminal. - As shown in the image below, the system asks you if you are sure you want to continue connecting. To continue, type
yes
. The large Unity logo appears to show you that you have successfully connected to Unity.
Option B: Connect to Unity using PuTTy (Windows users only)
Windows users can use PuTTY to connect to Unity. Download and install PuTTy to get started.
Connect using PuTTy
- After PuTTy is downloaded, open PuTTY and enter the hostname
unity.rc.umass.edu
on the main page.
- On the left sidebar, click Connection > Data.
- In the box next to Auto-login username, enter your Unity username.
- On the left sidebar, click Connection > SSH > Auth.
- Click Browse… and locate your private key location.
- On the left side bar, click Session to go back to the main page.
- Under Saved Sessions, type Unity as the profile name.
- To save the profile you created, click Save. Your profile saves so you don’t have to enter this information every time you want to connect to Unity.