Connect to CASLab Linux Using the Built-in Terminal (Windows, Mac, Linux)

The latest versions of Windows, Mac, and Linux all have SSH capabilities built into their terminals.

  • In Windows, go to the Start menu and search for “PowerShell” (or “Command Prompt” – both work.
  • On a Mac, go to Launchpad (or do a Spotlight search with Cmd+Space) and search for “terminal.”
  • On Linux, it depends on which distribution, but there should be a similar application launcher you can search for “terminal” in.

Once in a terminal window, type the following:

ssh <netid>@<server>

where <netid> is your username and <server> is the name of the machine or host you are trying to connect to.

For example, if my netid was 12abc34 and I wanted to connect to linux2.caslab.queensu.ca, I would type: ssh 12abc34@linux2.caslab.queensu.ca.

If it’s your first time connecting to this host from your current device, you will be prompted to accept an encryption key. Simply type “yes” and press enter.

You will then be asked for your password. Type it in and note that nothing will appear to make it look like you have typed anything. This is normal. If you make a mistake, press backspace a bunch of times and try again.

The whole process is illustrated in the following animation (using Windows PowerShell, but it is the same on all platforms):

And that’s it. If you have any problems, please consult the FAQ or contact help@cs.queensu.ca.

SFTP to CASLab Using Filezilla (Windows, Mac, Linux)

FileZilla is a cross platform FTP client. It’s older and less updated than Cyberduck (recommended), but it works. Beware of bundled adware in the free version.

Once installed and launched you’ll see a window that looks like this:

Click this icon on the top left:

In the resulting window, click the “New Site” button. Give it a name like “CASLab” and under the “General” tab put “files.caslab.queensu.ca” are the “Host”, “22” as the “Port” and select “SFTP – SSH File Transfer Protocol” from the dropdown. Then select “Normal” as the “Logon Type” and enter you Queen’s NetID and password. Then click the “OK” button.

You may get a popup about remembering passwords. You can choose to save them, have it prompt each time, or set a master password for all future stored passwords.

Now click the arrow next to that icon you clicked previously and select “CASLab” (or whatever you called it).

You will be prompted to accept an encryption key upon first connecting. Check “Always trust this host, add this key to the cache” (so you won’t be prompted in the future) and click the “OK” button.

You should now see your files.

ou can drag files from the left side to the right side to copy files from your local computer to CASLab Linux and vice versa.

If you have any problems, please consult the FAQ or contact help@cs.queensu.ca.

Connect to CASLab Linux with Visual Studio Code (VS Code)

Microsoft’s Visual Studio Code is a popular cross-platform code editor. You can use to connect to CASLab Linux and create/open/edit files, as well as run commands through the built in terminal. This guide will show you how to set it up.

Download Visual Studio Code.

Installing Remote – SSH Extension

Before you can connect to CASLab Linux with VS Code, you must first install the Remote – SSH extension.

Go to the Extensions tab on the left sidebar and search for “ssh” in the text box. Find “Remote – SSH” by Microsoft from the list and click “Install.”

After installing the Remote – SSH extension, you should see a new icon appear on the sidebar:

Setting up a SSH Target

First, we have to set up a new SSH target for one of the Linux VMs. Note: Unlike in other tutorials, you won’t be able to use linux.caslab.queensu.ca, which is the VM that lets you select a particular VM. Instead, you will have to select a VM to use from the following list:

  • linux1.caslab.queensu.ca
  • linux2.caslab.queensu.ca
  • linux3.caslab.queensu.ca
  • linux4.caslab.queensu.ca
  • linux5.caslab.queensu.ca
  • linux6.caslab.queensu.ca

For the images in the rest of this guide, we will use linux1.caslab.queensu.ca, but you should pick your own VM so that everyone isn’t using the same one.

In VS Code, click on the new Remote – SSH icon in the sidebar. Hover over where it “SSH TARGETS” and click the “+” button.

If this is your first time using the extension, you will be asked to choose the location of the configuration file. In most cases, you should pick the first option is presents. (Note actual path will differ by platform.)

The next asks for the “SSH Connection Command.” Here you will type:

ssh <your netid>@<linux1, linux2, ... linux6>.caslab.queensu.ca

where <your netid> is your netid and <linux1, linux2, … linux6> is whatever Linux VM you chose. Press Enter when you’re done.

You should now see your SSH Target in the sidebar.

You may repeat these steps for more than one Linux VM should you need to use another one. (Note that your files are the same across all VMs.)

Connecting to an SSH Target

In the Remote Explorer sidebar, right click on your newly created target for your chosen Linux VM and click “Connect to Host in Current Window” (or “Connect to Host in New Window” – it doesn’t really matter).

You will be asked to select the platform of the remote host. Select “Linux” from the list.

The next prompt will ask you to accept the SSH fingerprint. Select “Continue.”

Finally, you will be asked to input your password. Input your Queen’s password and press Enter.
(Note: this is the only prompt you will get after the first time connecting.)

If all goes right, you should now be connected to your chosen CASLab Linux VM.

Opening Your Home Directory

You may notice that you don’t see any files yet. First we must open your home directory. After connecting to your VM, got to File > Open Folder…

A prompt will ask you to select a folder to open on the remote server. By default this should be your home directory:

/home/<your netid>

If it’s not, enter the path above (replacing <your netid> with your netid). Then press OK or hit Enter.

Enter your Queen’s password again.

The first time you open a new folder, you will be asked it you trust the authors of the files in the folder. Click “Yes, I trust the authors.”

You should now see all your files in the sidebar on the left.

Opening, Editing, Creating and Uploading Files

Once you are connected and have opened your home directory, opening and editing your files is pretty straight forward. To open a file, find it in the Explorer sidebar on the left and click on it.

The file will open in the editor. From there, any changes you make will be saved directly to the file on the server when you Save the file (File > Save, or Ctrl + S).

To create a new file or folder, find the place in the directory tree of the Explorer sidebar, right click where you want the file/folder to be, and click New File, or New Folder.

You can also right click on files and folders to rename then or delete them. (Note that when you delete something on the server, it is gone forever. There is no Recycle Bin, so be careful.)

You can also move files from your local computer onto CASLab by dragging and dropping them from your OS to the Explorer pane in VS Code. This will upload a copy to the server. Conversely, you can right click files in the Explorer pane and click Download… to download them to your local machine.

Running/Compiling Code on CASLab Linux

VS Code has a built-in terminal for running commands on the server. To see it, click View > Terminal.

You’ll see the terminal at the bottom of the window under the editor.

From there, you can run commands on the server to compile and execute your code, without having to open a separate SSH session in another window/application. Commands for compiling and/or running your code will depend on the language you’re using. Ask your TA for help if you don’t know how to compile or run code in your language from the terminal.

SFTP to Linux Using Cyberduck (Windows, Mac)

Cyberduck is a free1 cloud storage browser with support for all kinds of protocols and services. One of those protocols is SFTP, which you can use to access your files on CASLab.

For the example below, we will be demonstrating using a CASLab Linux server. If you are trying to connect to another Linux server or machine, please replace the following:

  • Nickname: Whatever you’d like to call this connection.
  • Server: The server/machine’s URL (like files.caslab.queensu.ca) or its IP address.
  • Username and Password: Your credentials to log onto that specific server/machine.

Once you have downloaded and installed Cyberduck and launch it, you should see a window that looks like this:

Click the “+” button at the bottom left side (highlighted above). This will add a new bookmark. Select “SFTP (SSH File Transfer Protocol)” from the dropdown. Give it a name like “CASLab” and use files.caslab.queensu.ca as the server. Then type your CASLab username and password and close the window.

Now you should see an item called “CASLab” (or whatever you called it) in the list.

Double click that new item to open a connection to CASLab. You may be prompted to accept an encryption key. Click “Allow.” (Check the “Always” checkbox to avoid this prompt in the future.)

And then you should see your files.

If you have any problems, please consult the FAQ first, then contact us if you’re still having difficulties.


  1. Cyberduck is donationware, which means it makes money from donations (pay what you want). It’s free, but you will be prompted to donate from time to time if you have not already donated and obtained a license key. You can get it by going to the Cyberduck website, or from the Windows / Mac store, but if you get it there, it will cost money (around $30 at the time of writing). There is no difference between the paid version and the free version – it’s just something to be aware of. ↩︎

Use X2Go Client to Log in to CASLab Linux

CASLab Linux and Unix machines can now be accessed from home using X2Go remote technology. X2Go allows users to have full-screen sessions at nearly full speed even over fairly slow connections from home.

X2Go is already installed on all CASLab machines.

Installing X2go on your machine

Download X2Go for your platform (Win, Mac, Linux) and install it.

Mac OS X Installation Note

There are a couple of extra steps you’ll have to do to install X2Go on a Mac. When you first open X2Go, you may get the following notification:

First, if you see this, you will have to go to your system preferences and then go to “Security and Privacy.” At the bottom of the window, it should display a message about X2Go being blocked. Simply click the “Open Anyway” button and you shouldn’t have to worry about it again.

The second step is to install an X11 server which can be obtained from the xQuartz homepage. If you don’t have it installed, you’ll get this notification:

Download XQuartz from the XQuartz homepage or simply click the link in the dialogue (shown above). Installation is fairly simple. Click the icon and go through the package installation wizard.

After installing XQuartz, you must log off and log on again for it to be detected. After doing that you should be able to proceed with these instructions.

Configuring X2Go

Once you’ve installed the X2Go client, open it with this icon:

X2go_icon

You will be prompted to start a new session:

X2go_session

Fill it out as seen below. For the Host, use one of:

  • linux1.caslab.queensu.ca
  • linux2.caslab.queensu.ca
  • linux3.caslab.queensu.ca
  • linux4.caslab.queensu.ca
  • linux5.caslab.queensu.ca
  • linux6.caslab.queensu.ca
X2go_session_config

Once your session is complete, you should see something like this:

X2go_session_connect

Click on the session “CASLab Linux” to the right. You will now see:

X2go_session_connect_2

After you enter your password and click OK, something like the following will display:

X2go_session_connecting

The first time you connect, you will be prompted to save the host key. Click “Yes.”

X2go_session_connecting_firsttime

In Windows, depending on your firewall settings, you may see the following. Click “Allow access”

X2go_session_connecting_win_firewall

Once you’ve successfully connected, you will be presented with the standard CASLab Linux desktop. Congratulations! You’re connected!

(Note: Depending on settings, your desktop may look a little different.)

When you’re done, don’t forget to log out. You can do this by clicking the power button in the applications menu at the top left. (Depending on your settings, you may instead have to click your name at the top right of the screen.) If you don’t, your session will continue to bog the system down for others, even when you aren’t using it.

Understanding Unix and Linux File Permissions

Unix file permissions are expressed in three octal digits. Running ls -a from a Unix (or Linux) terminal on a file with permissions 644 might look like this:

-rw-r--r--    1 bhall  staff      2216  6 Dec  2007 x11_update.sh

The first, or left-most, octal digit (“6” in this example) indicates a file’s owner’s (your) permissions, the second a user group’s permissions, and the third public permissions (applying to everyone else).

Here is a table of values showing the effect that each of these octal digits has on a specific owner or user group’s permissions.

OCTALBINARY*EFFECT
0---No permissions (access blocked)
1--xExecutable**
2-w-Writable
3-wxWritable, executable
4r--Readable (read-only)
5r-xReadable, executable
6rw-Readable, writable
7rwxReadable, writable, executable
* Each octal digit can be represented in three bits corresponding, as read from left to right, to read (r), write (w) and executable (x) permissions. Thus, a 6 octal digit, normally written 110 in binary, shows up in a directory listing as rw-, meaning read and write permissions are granted, but not execute.
** Directories must have the executable bit set to be accessible

So, a file with permissions 755 would be readable, writable, and executable for you (as the file’s owner), and readable and executable, but not writable for the group and for the world (public). To apply this set of permissions to a file called myscript, you would run the following command in a terminal window:

chmod 755 myscript

Generally, folders need to have permissions 755 for everyone to be able to read the contents, and files need to have permissions 644 to be viewable but not editable by anyone other than you.

If these are web files, Apache (the web server) runs as another user, so files edited by Apache have to be writable by the Apache process, so the file(s) have to be at least group writable if Apache’s user is in your group.

Of course, you should give least permissions, so if Apache needs to edit a particular file, it should be as weak as 666, but the directory that the file lives in can be 755, and other files can be 644.

For further reading, see https://www.tutorialspoint.com/unix/unix-file-permission.htm.