VT ARC - Remote Connections with SSH¶
Background¶
We use Virginia Tech's computing facilities for our code developments in this course. The computing resources are: - VT Advanced Research Computing (ARC)
To access those resources, we use the Secure Shell (SSH) to log into remote computers hosted on VT's campus from a command line interface. Depending on your operating system the command line interface you use will be one of these programs: - on Windows: PowerShell - on macOS: Terminal - on Ubuntu Linux: Terminal
After logging into any of VT's computers, the terminal will be that of a Linux operating system, because all computing resources are running Linux.
Important¶
To access VT's computing resources, you either need to be on campus or you need to connect to campus via the VPN (aka. Pulse Secure).
ARC's official documentation¶
Useful links at the ARC documentation¶
Setup SSH¶
The following setup steps need to be done only once.
How-To: Transfer SSH public-key to ARC computers¶
To be able to connect from your laptop to any ARC computer.
Requires:
- you created SSH keys on your laptop
Steps:
- Copy the contents of only your public SSH key from your computer.
- In the terminal, show the content of your public SSH key
It will produce multiple lines of mostly randomly looking characters.
cat ~/.ssh/id_rsa.pub -
With the mouse cursor, select all the lines and characters between the prompts (not including the prompts), meaning between the
cat ~/.ssh/id_rsa.pubprompt and the empty prompt. -
From your terminal, initiate to connect to the server (i.e., "ssh into TinkerCliffs"). Run the command: (where you replace
<your_vt_pid>with your actual PID)Note the numberssh <your_vt_pid>@tinkercliffs2.arc.vt.edu2after the nametinkercliffs. -
If you attempting to ssh into TinkerCliffs for the first time, you may need to accept the fingerprint. (type "yes" and hit Enter key)
-
When prompted for your password, you will need to enter your VT PID password. After entering your VT PID password, you will receive a DUO challenge (on your phone).
-
Create the directory
.sshNote: The use of themkdir -p .ssh-poption is explained in the manual, run:man mkdir -
Paste the content of the public SSH key (copied to your computer's clipboard in step 1.) to a list of authorized keys:
Switch to Vim's insert modevim ~/.ssh/authorized_keysi, paste clipboard into terminal (e.g., with mouse right-click menu), save and quit Vim:wq.
How-To: Set up SSH keys on ARC computers¶
To be able to clone Git repos when logged in to an ARC computer.
Steps:
-
In your terminal, ssh into TinkerCliffs (see how-to above).
-
Generate a public-private pair of SSH keys for your ARC account.
- Run SSH key generator (with RSA encryption)
ssh-keygen -t rsa -b 4096 - Press Enter key to accept the suggested file location
(usually
<your_home_directory>/.ssh/id_rsa). - It is recommended that you invent and enter a password. Entering this password will be needed each time a remote connection via SSH is used. If you do choose to enter a password be sure to remember it, because you will need to enter the password every time you use SSH to log into an ARC computer.
Outcome¶
Files of the SSH keys should exist. Check with:
cd ~
ls .ssh
id_* and id_*.pub, for instance,
id_rsa and id_rsa.pub.
How-To: Add the SSH public key to your user profile on code.vt.edu¶
Do these steps in the web browser:
1. At code.vt.edu, click on your avatar icon.
2. Select Preferences.
3. On the left sidebar, select SSH Keys.
4. Select Add new key.
5. In the Key box, paste the contents of your public key from an ARC computer, using the usual command: cat ~/.ssh/id_rsa.pub
6. In the Title box, type a description, like "ARC".
7. Select Add key.
How-To: SSH into ARC's TinkerCliffs computer¶
Requires the completion of the steps above: - Transfer SSH public-key to ARC computers
Steps:
-
From your terminal, initiate to connect to the server (i.e., "ssh into TinkerCliffs"). Run the command: (where you replace
<your_vt_pid>with your actual PID)Note the numberssh <your_vt_pid>@tinkercliffs2.arc.vt.edu2after the nametinkercliffs. -
When asked to "Enter passphrase for key", this is asking for the password that you invented when creating SSH keys!
Enter the password associated with your SSH key. Note that the cursor in the terminal will not move even though you are entering the password.
Outcome¶
When logging into TinkerCliffs via ssh successfully, the following output in the terminal appears.
Enter passphrase for key '<your_laptops_home_directory>/.ssh/id_rsa':
Last login: Tue Jul 25 15:06:40 2023 from 2607:b400:26:0:6851:65:3236:5a8b
+---------------------------------------------------------------------------+
| This computer is the property of Virginia Polytechnic Institute and State |
| University. Use of this equipment implies agreement to the university’s |
| Acceptable Use Policy (Policy 7000). For more information, please visit: |
| https://vt.edu/acceptable-use.html |
+---------------------------------------------------------------------------+
+---------------------------------------------------------------------------+
| NOTE: VT Enterprise Directory Password authentication requires a DUO |
| second factor challenge. After your password is provided, you |
| will receive a DUO challenge. |
+---------------------------------------------------------------------------+
<your_vt_pid>@tinkercliffs2 ~]$ _
pwd + Enter)
<your_vt_pid>@tinkercliffs2 ~]$ pwd
/home/<your_vt_pid>
/home/<your_vt_pid> is your home directory on the server.