Accessing Course Account from Macs

This page describes some ways to connect to the course account from Macs.

Fill this out to make these instructions use your WatIAM ID and course:

Your WatIAM ID (ex. yc2lee):
Course Account (ex. cs115):

Connect using Samba (smb)

Samba lets you mount the course account as a drive/folder so that you can work with the course's files in a Finder window.

If you encounter connection issues like random disconnects or it takes forever to connect, an alternative to Samba is SSHFS, described below.

Getting Access: You will be given access automatically in your first week of work. If you don't have access, please ask your CSCF Point of Contact or your ISC (your ISC will then contact CSCF, because only CSCF staff can give Samba access).

Step 1 (if off-campus): If you're off-campus, like at home, first connect to the campus network using the UW Cisco AnyConnect VPN.

Step 2: Click on the desktop or the Finder icon in the Dock (bar at the bottom of the screen). Then in the Finder menu bar at the top of the screen, click on Go and choose "Connect to Server..."

Step 3: Use Server Address:

smb://smb-files.student.cs.uwaterloo.ca/csNNN

You can click the '+' button to save the address. Click Connect.

Step 4: For Name, enter TEACHING\yourQuestID and use your student.cs password (reset password if needed). Click Connect.

Connect using SSH in a Terminal

You can work with course account files by typing commands in a Terminal.

Step 1 - Generating SSH keys: On your Mac, open the Terminal app. Then run the command: ssh-keygen

It will ask you to enter file in which to save the key. Press Enter to accept the default. If you're asked "Overwrite (y/n)?" type y for yes.

Then it will ask if you want to set a passphrase. The passphrase is a password that will be used to SSH into the course account from your Mac computer. It is a brand new password that is unrelated to anything else. When entering a password, nothing will be displayed on the screen for security.

When done, you should see something like this:

Screen_Shot_2024-09-05_at_5.03.06_PM.png

Step 2 - Adding your key: In the Mac Terminal, run the command: cat ~/.ssh/id_rsa.pub

This will display a bunch of random characters, starting with ssh-rsa AAAAB3Nz..... This is called the public key.

To get access to csNNN, the public key should be added near the top of the "authorized_keys" file in the course account, in the ".ssh" folder (note the folder name starts with a period).

One way is to send the public key to Nick Lee at CSCF. Copy-paste the whole ssh-rsa AAAAB3Nz.... text and send it over email.

Alternatively, you can mount the csNNN account using Samba. Then press Command + Shift + . (period) to show the ".ssh" folder. Then edit the authorized_keys file (right-click, Open With, Other, then use TextEdit) and add your public key to the top yourself. The public key should be all on one line.

Step 3 - Checking that you have access: Open the Mac Terminal and run this command to SSH into the course account:

ssh csNNN@linux.student.cs.uwaterloo.ca

If you're asked to continue, enter yes.

VS Code Extension

If your concern is primarily editing a batch of files and you use the VS Code editor, a slick solution appears to be installing the "Remote - SSH" extension from Microsoft. It allows you to show a remote directory in the left pane of VS Code and navigate it easily, just like opening a local directory. This requires that you already have SSH access to the course account (see above).

  1. Open VS Code
  2. Open the extensions window (look for an icon with four squares in the left border; one of the squares is "popped" out from the 2x2 grid)
  3. Search for "Remote - SSH" and click install.
  4. Look for a "><" icon in the lower left corner of the window. Click it.
  5. In the field that opens, select either "Connect to host" or "Connect current window to host", type "COURSE_ACCOUNT@linux.student.cs.uwaterloo.ca" (no double quotes; replace COURSE_ACCOUNT with CS135 or similar)
  6. In a few seconds, an "Open Folder" button will appear. Click it an navigate to the directory on the host that you would like to open.
That's it!
Edit | Attach | Watch | Print version | History: r14 < r13 < r12 < r11 < r10 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r14 - 2024-09-05 - YiLee
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback