SSH

In this course, we will be working on a server rather than on our personal computers, which I'll call "laptops" since most of you will have a laptop. If you happen to have a desktop, just treat the terms as synonyms.

Do to that, we have to use a network connection called SSH.

Terminology

Let's cover a little bit of terminology:

A server is a computer on the Internet that runs 24/7 and provides, uh, services to other computers (called "clients"). Your laptop is a possible client.

Servers usually don't have a monitor, a keyboard, a mouse or any of those things (peripherals) that your laptop has. They usually just have a processor, memory, disks and network cables. They're often mounted in racks with other servers. They might look like this:

banks of computers on racks
Servers at Wikimedia

(In fact, they might be virtual, meaning that software on a real, physical computer emulates the server. Virtual servers can be migrated from one physical host to another, if their original host needs to power down for maintenance or something.)

Dix

The server we will be using in CS 304 is called dix. Dix is a machine in the wellesley.edu domain, so its full name is dix.wellesley.edu. That name is an alias for cs.wellesley.edu.

In fact, Dix is a virtual server, running on some hardware that LTS owns.

Services

Dix provides lots of services to clients over the network, which you can picture like this:

Server-based-network
Client-Server Network. The server (such as Dix) is the central machine that lacks a monitor. The clients are the surrounding machines that connect to the server.

What kind of services? Things like:

  • web services: Dix hosts web pages, which means clients can request them and Dix sends them the requested page. That's how you are reading this page.
  • file services: Users can upload/download files using FTP clients like Fetch, CyberDuck or WinSCP (you probably did that in CS 111)
  • ssh: today's topic

Using SSH

We can and will use SSH in several distinct ways:

  • VS Code. When we use the Remote Development extension to VS Code, it uses SSH behind the scenes. It uses SSH to connect to Dix, allowing you to login and run a shell on Dix. VS Code also installs some software to help mediate the communication between Dix and VS Code running on your laptop. That mediation includes allowing you to edit files that are on Dix, using the VS Code running on your laptop. It's very cool.
  • The ssh command. There are a handful of things you'll have to do that involve running the SSH command on your laptop, instead of via VS Code. I'll describe that when we get to it in the course (which will be quite soon, but not the first day); you don't have to read the linked information until then.
  • SSH Tunnels. We'll use that later in the course, when we want to connect our laptop's web browser to our web applications. You can wait to read that.

Reason

Why do we have to work on the server? The main reason is that when we create our web applications, the files have to be on Dix and the processes have to be running on Dix. Dix also hosts our database software, so we access that data directly by running our Python programs on Dix. Essentially, our laptop is only providing a keyboard, monitor and mouse: all the real work is happening on Dix

Conclusion

That's it for now. We'll use SSH a zillion times this semester, so plan to get comfortable with this. Soon, we'll learn a way to streamline our use of SSH and avoid having to type our password a zillion times.