<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2022F_Lecture_9</id>
	<title>Operating Systems 2022F Lecture 9 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2022F_Lecture_9"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F_Lecture_9&amp;action=history"/>
	<updated>2026-04-05T22:41:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F_Lecture_9&amp;diff=24101&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;==Video==  Video from the lecture given on October 6, 2022 is now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.m4v video] * [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.cc.vtt auto-generated captions] Video is also available through Brightspace (Resources-&gt;Zoom meeting-&gt;Cloud Recordings tab)  ==Notes==  &lt;pre&gt; Lecture 9 --------- Admin stuff  - Assignment 2 is due Tues...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F_Lecture_9&amp;diff=24101&amp;oldid=prev"/>
		<updated>2022-10-06T19:48:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Video==  Video from the lecture given on October 6, 2022 is now available: * [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.m4v video] * [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.cc.vtt auto-generated captions] Video is also available through Brightspace (Resources-&amp;gt;Zoom meeting-&amp;gt;Cloud Recordings tab)  ==Notes==  &amp;lt;pre&amp;gt; Lecture 9 --------- Admin stuff  - Assignment 2 is due Tues...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Video==&lt;br /&gt;
&lt;br /&gt;
Video from the lecture given on October 6, 2022 is now available:&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.m4v video]&lt;br /&gt;
* [https://homeostasis.scs.carleton.ca/~soma/os-2022f/lectures/comp3000-2022f-lec09-20221006.cc.vtt auto-generated captions]&lt;br /&gt;
Video is also available through Brightspace (Resources-&amp;gt;Zoom meeting-&amp;gt;Cloud Recordings tab)&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Lecture 9&lt;br /&gt;
---------&lt;br /&gt;
Admin stuff&lt;br /&gt;
 - Assignment 2 is due Tuesday&lt;br /&gt;
 - Midterm is Thursday&lt;br /&gt;
 - Monday is Thanksgiving&lt;br /&gt;
 - please get your T3 and T4 checked off by the end of tomorrow if possible, as&lt;br /&gt;
   TA&amp;#039;s aren&amp;#039;t working Monday and it has to be done by 11:30 AM on Tuesday&lt;br /&gt;
&lt;br /&gt;
Today I was going to&lt;br /&gt;
 - answer questions on T3, T4, and A2&lt;br /&gt;
 - talk about ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Format of the midterm&lt;br /&gt;
 - same as assignment, except will be a PDF you download via brightspace&lt;br /&gt;
 - answers uploaded as a text file&lt;br /&gt;
 - you&amp;#039;ll have 80 minutes (class time)&lt;br /&gt;
 - open book, open note, open internet&lt;br /&gt;
    - but NO COLLABORATION&lt;br /&gt;
 - I will be the lecture zoom to answer questions during the midterm, but you&lt;br /&gt;
   don&amp;#039;t need to show up&lt;br /&gt;
 - I&amp;#039;ll also answer questions via PM on Teams&lt;br /&gt;
 - remember I&amp;#039;ll be holding randomized interviews after the midterm is graded&lt;br /&gt;
   - you may volunteer for interviews, this is where I&amp;#039;ll regrade&lt;br /&gt;
 - remember questions are based on the material in the assignments, not the tutorials&lt;br /&gt;
   - tutorials cover more material than the assignments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dup2&lt;br /&gt;
 - when you open a file, it gets an arbitrary file descriptor&lt;br /&gt;
   (well, the next available one generally but you can&amp;#039;t count on it)&lt;br /&gt;
 - you use dup2 to copy a file descriptor to a specific one&lt;br /&gt;
 - so this is how you open something on 0, 1, or 2&lt;br /&gt;
    - open first,&lt;br /&gt;
    - then dup2 to 0, 1, or 2 (or any specific file descriptor)&lt;br /&gt;
&lt;br /&gt;
When answering programming questions&lt;br /&gt;
 - describe at a high level what you did&lt;br /&gt;
 - then include code snippets and explain where they should go in the program&lt;br /&gt;
   (line numbers/and or context, just make it clear)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Going back to A1, if you omit the call to wait, you&amp;#039;ll get zombies&lt;br /&gt;
 - that will last until 3000menu terminates&lt;br /&gt;
 - because wait is how we eliminate zombies&lt;br /&gt;
 - zombies are just child processes that have terminated&lt;br /&gt;
   but are waiting around to give their return value&lt;br /&gt;
&lt;br /&gt;
Before ssh, there was telnet and rlogin/rsh&lt;br /&gt;
 - simple TCP/IP connections to a server, plain text&lt;br /&gt;
 - authentication was either&lt;br /&gt;
    - telnet: type in the right password (in the clear to the server)&lt;br /&gt;
    - rsh/rlogin: password, or coming from trusted host (IP address)&lt;br /&gt;
 - problem: anyone could listen in and capture passwords,&lt;br /&gt;
   or could just impersonate another host&lt;br /&gt;
&lt;br /&gt;
ssh is a secure version of rsh&lt;br /&gt;
 - basic syntax is very similar, but has many more options&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
basic syntax: ssh [user@]&amp;lt;host&amp;gt; [command]&lt;br /&gt;
 - no command, you get a login shell&lt;br /&gt;
&lt;br /&gt;
Underlying ssh is public key cryptography (&amp;quot;certificates&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Classic cryptography is based on shared secrets, like a password&lt;br /&gt;
 - both parties know the secret&lt;br /&gt;
 - relationship is &amp;quot;symmetric&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Symmetric cryptography can be VERY secure, but it has one fundamental weakness&lt;br /&gt;
 - how do you get the secret to be shared in the first place?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Public key cryptography changes the game&lt;br /&gt;
 - instead of a shared secret, we have two pieces of information&lt;br /&gt;
   - a public part, that can be shared with everyone&lt;br /&gt;
   - a secret part (keep it private)&lt;br /&gt;
&lt;br /&gt;
The cool thing about these is that&lt;br /&gt;
 - what one can do, the other can undo&lt;br /&gt;
 - so if you encrypt with the secret part, you decrypt with the public part&lt;br /&gt;
 - and vice versa&lt;br /&gt;
&lt;br /&gt;
If I publish my public part as my public key or &amp;quot;certificate&amp;quot;&lt;br /&gt;
  - certificate is a public key + metadata, like my name &amp;amp; email address&lt;br /&gt;
Then anyone can use my certificate to send me a secret message&lt;br /&gt;
  - only I can decrypt, because only I have the private part&lt;br /&gt;
&lt;br /&gt;
Similarly, I can digitally sign anything&lt;br /&gt;
 - I create the signature using my private key&lt;br /&gt;
 - Anyone can verify the signature using the public key&lt;br /&gt;
&lt;br /&gt;
(in reality we often have different algorithms for encryption &amp;amp; signing)&lt;br /&gt;
&lt;br /&gt;
So what are we doing with SSH?&lt;br /&gt;
 - the server and the client both have public keys (some short, some long term)&lt;br /&gt;
   that they exchange&lt;br /&gt;
 - they use these to set up a shared secret key&lt;br /&gt;
 - this key is used to encrypt the entire communication&lt;br /&gt;
&lt;br /&gt;
So, how do you know you&amp;#039;re talking to the right server?&lt;br /&gt;
 - they have the &amp;quot;right&amp;quot; secret key corresponding to a known public key&lt;br /&gt;
    (stored in .ssh/known_hosts on the local system)&lt;br /&gt;
 - it is saved on first use&lt;br /&gt;
&lt;br /&gt;
how does the server know you&amp;#039;re an authorized user?&lt;br /&gt;
 - you enter your password&lt;br /&gt;
 - you show that you have the secret key corresponding to the public&lt;br /&gt;
   key on record for this account&lt;br /&gt;
    (stored in .ssh/authorized_keys on the remote system)&lt;br /&gt;
 - we manually put the key in this file&lt;br /&gt;
&lt;br /&gt;
So what about certificate authorities?&lt;br /&gt;
 - they just sign certificates, i.e., they vouch for them&lt;br /&gt;
 - so instead of saving on first use or transferring manually,&lt;br /&gt;
   we just check the signature and see if it has been signed by&lt;br /&gt;
   someone we trust&lt;br /&gt;
 - browsers include the certificates of many CAs&lt;br /&gt;
   - so your browser trusts the certificates presented by any website&lt;br /&gt;
     that has been signed by one of these CA&amp;#039;s public keys&lt;br /&gt;
   - if this fails, you get a warning about an insecure connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some public key algorithms are relatively simple to implement&lt;br /&gt;
 - such as RSA&lt;br /&gt;
&lt;br /&gt;
DO NOT IMPLEMENT YOUR OWN CRYPTOGRAPHY&lt;br /&gt;
 - don&amp;#039;t make up your own algorithms&lt;br /&gt;
 - don&amp;#039;t just implement your own version of known algorithms&lt;br /&gt;
MANY MANY attacks, you&amp;#039;ll mess things up, and it can lead&lt;br /&gt;
to catastrophic failures&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>