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:
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:
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).
- Open VS Code
- 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)
- Search for "Remote - SSH" and click install.
- Look for a "><" icon in the lower left corner of the window. Click it.
- 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)
- 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!