Okay, I'm gonna get started now.
I'm not sure about you, how your break.
How you spent your break. I had a very busy break. I was working on a grant application.
I was attending a conference.
My wife was away so I was also on with the kids, it was, it was a little crazy. So, I'm, I am behind on grading the T's are not so behind on grading. So, basically.
So, basically.
So basically the midterm an assignment to should be graded by Thursday. Yeah.
Yeah. I was, yeah my grant got out kind of at the last minute. It was do yesterday was like, I'm kind of happy with how it came out, I could send it around and people are curious.
But, um, but anyway so.
So your assignment to in the midterm should come out by Thursday.
So I'm right now in catch up mode stuff I would have liked to have gotten done last week it's kind of like
it so well. So this is all the midterms, basically the TS have done their part and grading and stuff actually combine it all together and so I'll post a schedule on Thursday and then we can start setting up talking about it.
So Thursday also go with the midterm solutions because they want to do now.
if you do have any tutorials that are not great if whatever reason.
Talk to your team.
That's like that should not be the case that should have been taken care of a while ago so let them do it.
Okay, okay. So, um,
I don't talk about this much before you both take the midterm, but after the midterm I emphasize this that.
So, if you, if you do better on the final than the midterm. So you can think of the midterm as a training thing training ground so like you said your grade is not trashed yet is basically what I'm saying.
Even if you did bad in the mature but hopefully now you understand what the kind of thing is I'm looking for, and we will talk on Thursday, about.
Yes.
If you do better on the midterm will replace the final.
Sorry. No such luck.
Because the final is going to have a lot of material that's not in the mid term
worth asking Sure.
So, so I'll post the scale Thursday.
So if you're if you go through your midterm, and you go like my answers, and here it's like I should have gotten marks. If you, if it just
it's just a brief thing.
So I'm.
no So, so the idea is that if you, if you are want to.
If you feel like you want to your grading isn't correct, sign up for an interview because that's actually what we do in the interview is go through your midterm and see if the grading makes sense.
We discussed the questions. So sign up for new you're not I mean, I will ask all of you to go over your answers. Basically, that's mostly random, because I'm not saying some of them might not be selected but mostly GS let us assume it's random, because
I this is just to make sure that your knowledge and what you put down on the midterm correlate, but if you want to just go through it and yeah sign up for the slot.
The to date well I haven't even posted the schedule yet so I'll do interviews, you know basically until we're done. They might take a week or two or something but I will, I'll make sure to talk to all of you.
So, anyway.
Okay so sorry.
I can you say no the news, if I asked you to do it if you asked to do an interview, i. You should say yes, otherwise
up. But again, it's just we're sort of talking about things. If I said so.
But again, it's just we're sort of talking about things. If I said so. So now let's start talking about tutorial five but that's for.
I will be a similar interview system for the final. Yes.
I will also be.
If you select for the midterm do less chance of being selected, I do.
I just do we are doing random selected, there's those are independent events. So, again, I mean, frankly, you're getting interviewed with you do an interview I'm probably going to, I might be able to increase your great so
the only time it's at all me it's a loss of a small amount of time and if you did something inappropriate then you might be at risk but otherwise you're talking.
Anyway, let's, let's just talk now with this, you know, so we are now here.
We've still got a good chunk of I know this is really the midpoint, technically of the lectures.
So we've got, you know, we've done 12 we've got 12 more.
Yes you choose your own time I'm going to sign up a schedule two things you're in, so fit into your schedule.
Yes, I mean, the interview is not meant to be punitive, but it is meant to be kind of a, it's a check on like really should be your work.
If you do the interview Do you get to see Roshi that is up to Roshi cannot.
I if you make a request I can try.
Anyway, let's up.
I haven't finished, I haven't calculated for grades on so I don't know yet how the midterms looking otherwise they'd be posted.
Well, I want to talk now about.
So let's then move on from administrative stuff.
How is tutorial five going, not do yet.
But how are you find that tutorial so far.
Are your questions I see that some of the Someone was asking if you haven't started yet you should definitely start.
Do you. Some of you are having some questions about SSH.
The total login thing is kind of broken for you so
difficult, difficult.
So if you're having trouble with the password list login.
So, you should definitely talk with your team. If you're having trouble getting SSH working. And if your TA can't debug it, we're saying problems or, you know, then, or you can just come to my office hours I'm happy to go through and figure out what's
going on with things, because some of these things sometimes weird stuff is happening but again if you're doing it from your VM, with a uniform base.
How do you restart the system after your change shell to a new.
Oh, good question.
So, so let's go through a couple of questions here on chat so what is, if I have to type in my key. Is that considered password less.
So, if you, if you try logging in and you're talking your password unlock your pass phrase to unlock your here I mean, it is because you're struggling to get the best just to protect it locally.
So there's a question about how do you restart the system after you change shell to a new default shell.
So you don't want to restart the system when you change shells, because there's no need to Unix systems are designed to not need to be the only time.
So, when you reboot.
You do need to reboot.
When the colonel gets upgraded.
There are ways to update it. There are some cool technologies just look up this thing called case Weiss but so linkage.
If you don't restart the system, I can SSH back to the user.
Someone can check the syntax I think it's pseudo service sec restart, um, if anyone wants to verify that that actually works.
Because I'm still going to questions.
So, it's so funny you said you change the order of set g ID and set your ID, it doesn't do anything different for me.
What should happen.
So if you haven't, if it doesn't fail you haven't dropped privileges. So,
Oh reboot. Yeah, sorry. Thank you.
Yeah. Um, I always use shut down dash are now, that's my thing to do and the reason why I like shut down dash are now is because I can say shut down dash are plus 15, because I actually do this often before I go to bed like I might be running a backup
sync from my desktop computer, and so I'm going to start it. I know it's going to take like five minutes or something, I don't want to wait around for it to complete before I do that, so I will do.
I'll do a pseudo I'll do I shut down dash, so I know.
OK, So,
the reason why.
Answering so
let's say we're great great. Okay.
Okay, I've got some questions on the actual results and so the questions the tutorial now.
I have a problem with. Okay, okay. So some people like six got some segue faults.
Six got some seg faults.
Okay. I'm going to start going through the questions here I'm kind of behind here on the chat here, so.
Okay, let's go let's start going through questions here think it sounds like there's no so I got some questions on five six, I think in 12.
Singer password list login to access.
I was thinking so I was thinking for 12 was setting up password list, x, login to access from the VM.
But I think it would be great to also do it from your home machines. Again, you know, I mean ideally to get both working.
But that requires understanding where your journey your keys are you can do it from the VM as a Linux way if you've got a Windows desktop you got to figure out the windows way of doing things a little windows has a command line SSH client now and monitoring
Hello Windows has a command line SSH client now in modern incarnations which should work. I'm not sure exactly where the SSH directory gets put.
So right so now so the question was, can you set FBI to shelter your users default show what changes do you have to make this change shell to accept 3000 shelves always break when you're on Facebook, can you change your new order to fix it.
What changes do you have to make this change shell to accept 3000 shelves always break when you run through the park, can you change your new order to fix it.
What problems did people see when they did six.
do they see I did six work.
Oh, the username being unknown right yes yeah exactly that's a username being unknown. That's right. Because, and the reason is, so what. So one thing that happens is is 3000 shell doesn't set environment variables.
Yeah yeah well you gotta put the path in at sea shells. So once you add it to.
Once you add 3000 shell to Etsy shells that it should work.
In terms of things breaking, I, as I recall, it's 3000 shell doesn't set environment variable so as he got user being unknown.
Yeah, environment doesn't have the proper username Variable Data responsibility the shell know. So that's the shell normally does 3000 shells pretty simplistic, but you can certainly add that functionality in.
So the unknown that was so new chip chip username to user the code.
Yep.
That's interesting if I type my.
So, if I do bash, it defines both user and username and 3000 shell just defines one of these.
So that's six.
Okay, so that's the default shall get so five is just getting it running
for eight is path, the only useful environment variable
deliverables are saf-t login. I'm.
me. Note that when you go to like,
Look, I have all these crazy things when I
me know.
I have definitely some SSH, you know it's a environment variable set up here, the question is is once you to run 3000 shell, as we go along the one that sets the variables not, you know.
All right. Thank you, 3000 walking does not for us.
Thank you. I'm just misspeaking.
So.
So here's the so basically what's it, so where it so here's the environment variables that 3000 shell is setting.
You can set what we own the question is do you need more things this is
how deep you go into so this is an important thing to understand about tutorials.
And this is my general philosophy here is.
I'm not typically looking for you just to get a one or two word answer what I'm looking at these questions are meant for you to go exploring to build up your mental model.
So,
what I much prefer to hear from you all. In terms of questions is not so much, what's the answer.
But what is going on here. What is the purpose of this Why did this happen. Why is this break, because when you asked me a why question.
Then I can kind of explain something about what's going on if you just like this I'm just, you know, okay, did you do the work I could, I could do it for you and we compare the answer and see if it's the same thing but it's the precise answers, oftentimes
don't matter, with much more matters is the process by which you've got them.
Yeah, so, like, when you look at these things it's like, why are we setting these variables.
What is being used for these are these things that regular shell set.
Exactly, you know if a process needs an environment variable setup, right.
So, so the question is SSH are truly secure connection
SSH uses end to end cryptography.
That best in breed a as an basically SSH is about as good as a web connection, like TLS.
Um, he's not secure.
You know for some measure thereof, of secure.
Okay, so I'm just trying to see there's a particular questions.
Okay, so now oh there there's this thing I do need to talk about yesterday I'm so
what I want to talk about now, though, is that this one I you talk about user IDs.
Don't ask about you IDs In this tutorial I don't think I did.
I didn't I did, I did talk about it.
So, you have a question for a question for okay good question for I asked about this good. So
what I want to talk about here is so if I do it here, I can see this is here. If I do,
I do it here.
I'm route, and you know route has you ID zero G ID, this is all fine. But if I do pseudo ID.
Oh.
Okay, well let's change that.
So what I'm doing right now is I'm going to. Is he means effective.
So, so let me explain. I have a full communion so I've got this ID here.
He is now owned by route,
which is actually the same as a regular ID thing. So I just type.
If I do that, that's all the same, but.
really
ideas doing something funny here.
Oh wait, stupid.
So its own this route.
There. Now, It is. I've set the asset.
Good. There we go.
So you notice here.
So let me explain what I just did.
So
you can go back later and watch the commands and look at the output and kind of freeze it, but let me give you a high level.
If I run this ID.
It says that it runs as a regular user.
And if I run it as root.
It says I'm route.
But I've now created this su ID. This one is set you ID route.
That means is, I've had this little I've checked basically enabled the asset.
And so you know you plus s, and it's owned by roots, so this will run as the user route.
Almost.
And here you'll notice that everything is exactly the same between here and here, except for one field right here.
You ID equals zero.
So what this means is, is when this program is run it runs as the regular user, it has all these all the regular privileges, you know, all the bigger identifiers and stuff.
But since it's running with the active user ID of zero.
It has the ability, so I am, it is a process that is students student can still send a signal to it say to kill it, because it's owned by student, But it has the privileges of route.
Yeah, so.
right. So, Why do we, so.
So,
so, so it's kind of like disguise who's access, it's, it's a process that's so you know this is what we're like if you look at.
So, change shell.
the file.
Its editing Etsy password Etsy password is owned by route, a regular user needs to edit this file, because they are indeed because you know, it's their thing, but they shouldn't be able to meet you look at.
There are all these different you know users.
I shouldn't be able to edit a regular used to build edit anything in this, I should just be able to edit. I want to be able to edit this thing right here, or this stuff maybe not the home directory, but at least this stuff here I should be able to edit
that limited access.
So,
so, so good so um so
basically so it lets you do one job, it basically lets you do something limited.
So this is why set you I need root binaries you know CEOs turning red when you do an ls there. They're dangerous because if there's a flaw in them any local user can get root access when they shouldn't be able to.
Okay so,
Mohammed, are you still confused.
I think you got the luxury of these,
but not.
You are you nice summary that that's exactly what is running as a normal user you ID equals you ID. It's all fine.
But if you ever EU it does not equal you ID it's probably because you've doing a set new ID, you know of some kind that basically when you didn't exactly he.
So what privileges you have, if you only the eg ID.
There is an eg ID.
And in fact, actually
See now.
Okay.
So for example, SSH agent. Oh yeah, that's interesting. SSH agent wants to be. Basically, it should be in the group SSH.
And so that, how that works. I think it probably sets it for files, probably for logins done. I'm curious about that but Otty, you know, oh yeah.
So, if you look at.
So you'll notice that TT wise are all owned by the group TTY so wall means right all you can send a message to all TT wise on the system, the ideas you want to broadcast the saying hello everyone remember Unix is designed as a multi user system.
So how do you do protections for that, you can just run, you know, you basically say okay you can run wall and wall you could runs and it will have it will get group TTY access.
So, it can access.
Anything that is owned by you know TGI, although.
Hmm.
I actually think that but actually that doesn't really work, because this is not group rideable wonder,
a regular teacher you guys are rideable.
Yes, so like the standard TT wise, if you do a, you know, if you write to those like so if you're on a console, and you run wall, it would log anyone was a non another hardwired console.
Again, most Linux systems, this doesn't matter but it is there.
Oh, what's the CNCRW. Okay.
Okay. No, so we'll
talk more about files.
We have a lot of things to talk about files.
Yeah, exactly.
So,
so let's, I just want to make sure there was anything else on the, I want to talk about files unless there's any like really pressing questions I've missed from tutorial fire if there's a special ed teacher asked me later post a message to the forums
I should be more on there.
But.
So, up.
regular files.
Symbolic links
character devices block devices IP.
So.
so, yes I'm gonna go through.
We're talking about everything here.
But I have to cover a couple of concepts.
First of
all, we're going to cover special files later. Yes, there is a pipe file.
Okay so well.
Don't ever really see that few that's not.
Can you make your own file type
you.
So we talked about file types.
I said these are different kinds of files things because you can't really need to change these you have to change how the OS works. They're pretty fundamental baked in things in each represents I'm very different concept now know Unix doesn't really have
file types a file is just a bunch of bytes.
You can have file extensions, like basically adopt, you know, you know.
Yes you can, you can fork Linux and change it if you want it to but not sure why you would. Well you might find some idea but you know he'll go.
But let's talk about, um.
So,
What is a file.
Any thoughts on what file is.
Let's actually that's a good time, a good excuse for a poll.
Hold on a second.
file.
Okay, let's go back to my polls here.
Okay, so you all are going
to.
Okay y'all about done.
I will. I'll give you I'll give you I'm gonna give a minute for this souls cu comes in here in the last 15 seconds.
Yes.
Oh,
and end it now.
Okay.
The correct answer is A.
Not B and C.
So, most of you missed this and that's why I asked this is a little bit of a tricky thing.
So it's not so it's not just for storing data.
And
so how do you know that this is not well if you go into slash proc.
If I do cat CP video CPU info.
So, so effectively This is a file simply a linear array of bytes. Yes.
Simply it's the file name is the key so firstly keep virtual files, well, so
we'll talk about virtual memory virtual memory later that's, that's a bigger concept. But, but the yeah the file name is the key. So,
yeah, where file name.
So, the reason why I want to emphasize.
This is so really we think of a files and this is the thing you step back is really, it's just an API. It's an API, you can open it you give it a key, you can get that you know you do a read on it you get some data usage right you put some data out there.
there. But, but it's really an API.
More than, it's commonly used to store data but that is by far not the only thing that you use it for.
So.
So, part of the magic of Unix.
Is that not everything is a file.
So just
know everything is a file in Unix.
What does a priori.
When you say air.
Right. What are they then, if not files.
Yeah, so that's so.
So that's.
So this is kind of the you know basic ideas, think of files are not just things for storing data files are an API that are used to
interpreter. It's a uniform API, on the other side the API can be arbitrary bites from whatever source, and the only thing that's uniform is ok, we have a namespace, which is the hierarchal.
So, we talk about
files and Unix you know as they always start with a slash all files are in the file system.
Okay, so, so what is user space a namespace okay so um okay Laker one names but so when you say namespace.
What is the name space.
It's a,
it's a scope. It's almost look at the definition but the idea is that.
so i. So,
so.
so it's like a, it's like a scope.
You know some programming languages have names spaces for for different identifiers. So, so like in a lot of languages you can well you think like anytime you start a function, a function scope is a namespace Yes.
Um, But, yeah, anything that's got this higher, it's how do you do names.
You think it was a set of keys.
Yeah.
Yeah, it's so up.
Well I mean in Unix there's only one name spaces that there's only one hierarchy of files. There's not like this hierarchy in that hierarchy there's just the hierarchy of files and.
Yeah, so I article. When I say hierarchical I'm saying that it's a true.
miss that but it's the following the key and the key, the file name is the key and the key value pair Exactly, yes.
So, so the question should be as.
So if you plug in a USB stick typically, it'll be sharp under the media hierarchy.
So how are these things all being combined together.
So we surely say is,
well.
So you can think of weeks as if you go to.
So, so there's this idea of a file system and a file system is.
So, why say file so let's, let's go here let's do a df def is showing me my current file systems. These are all the file systems that are currently mounted in my system and you notice that there's, there's one main file system, which is for slash and
slash is, you know, that's where our main things is this dev mapper LG zero Lv group so this is.
There's this will talk about where this comes from but there's a thing called the logical volume manager, it's LLVM Yes.
But for now, just say, this is basically this is our desk is our virtual disk here. um, let's try to my home machine.
You'll notice here, this is I this is my home machine has an envy me SSD.
Um, I will talk about the, the new user thing in a second. So, so my home, my main file system here, my slash is this envy me drive this envy me drive is actually attached is actually an external witness, no that's no no that's right right so, yeah, this
one's internal to my laptop.
Dev mapper so my data. This is an external drive, it's actually an encrypted drive.
Because I keep my home directory and encrypted and you know thing and so that that is gets mapped to so my data. And then I have another drive attached, which is my home backup.
This is for backups that run,
there's this little thing here this boot FBI. This is stuff for booting up the computer.
We will talk about later but again it's on the end. Notice this is this envy me, zero. So this is like, you know, the envy me drive so basically an SSD.
This is zero because we know good arrays start at zero, I guess.
And this is the P means the partition, because he invited the multiple partitions up here so.
So,
so right now. There's a lot of me basically once you start looking at this.
This is
finally file systems is a big topic. There's a lot of things, if you really going to understand what's going on a Linux system.
You need to understand what's going on with the file systems, most, most of the time you don't have to think about the file systems are sort of their their work he's he is hierarchical you know keys you know as as the file names and you don't think about
it. But when you are know what's actually going on, you have to understand what those file systems are what they need.
Because what actually happens when you access a file varies depending upon what file system is there.
lot of practice with partitions when you do Arch Linux Oh yes.
user doesn't get a file system, they could, in principle, but they normally just get a directory.
So,
let's see if I can show you what I need.
So, if I look at slash HD to why I can't get on with that. Well, you're going to play with this but all these file systems are originally an empty directory and basically you didn't just say what I mounted you replace.
So when we not do we forget exactly
mouth is a system call.
If you run the mount command. It will make a new process. And then you're probably if you do it for Michelle remember for exactly are for processes mounting is about file systems, completely separate things.
So,
you have infinite mount point, it's just an empty directory.
Yeah, it's just, it's just a directory, you have any directory can be a mount point. Once you mounted on top of it, it changes now we're going to see this.
I'm.
This is the, this is the stuff of tutorial six it you know
yeah this this is, this is a lot of stuff to wrap your head around.
Don't worry. This is the. Okay, you know, before the midterm.
We really were touched talking about processes and it's more the.
Okay, here are the abstractions that you normally you.
Second half, we're now doing, what are the abstractions, that actually make the system work. So it's a big thing and the idea is that you have to understand the first part stuff because you the other stuff doesn't make sense without reference to the first
part so we have to go through that goes here but this is a.
There's a lot. So, and this is where actually.
turns out your textbook was actually written by folks who have done research and file systems. So they definitely have a very good treatment of file systems and it's worth discussing.
There's just one last, we're going to make this all very concrete starting on Thursday. I'm going to show you tutorial six, and we'll start talking about we start playing with these file systems and making your own, but
before we do that, there's one concept I have to talk about, which will probably I'll start I'll start it now because we got five minutes.
But we'll continue this next time. So,
oo, the file names when I say hidden they do not become dot files no they are just inaccessible
will be
inaccessible into the file system.
Really, there are those. So when you mount something on top of a non empty directory, you've hidden those files, mean they're basically medically inaccessible because you've taken away their names, their names now refer to the file system you've mounted.
So you're going to see this but basically, until you imagine that you have no name for them, so you can't access them.
Yeah, they're hidden from the following example, so I nodes.
Okay so, So I see a level of indirection where I mean is, it's, it's like a.
So, it's just saying that we're adding a level of
problems in computer science are often solved by adding levels of interaction with saying that do rather than just saying, a refers to be.
And then what happens is is, what if I want.
So if a refers to be. And then if I want to change be I have to go through a but what if I want to be able to do something else or anytime we add in you know classes and other levels of abstraction so you can think of that as a levels of indirection which
basically means that I did.
So here's a level of indirection.
If you.
I could say, Oh, you should go to go to the store, or, you know, go to the store on you know Bank Street, go to the store and break free now 1224 Bank stickers on you know like that's an address.
You're saying the drug war I can say.
Instead of saying go to that store I could say, go look up.
Go look up Tim Hortons. And, you know, you know, go to the Tim Hortons on Bank Street. So there you have this interaction where you first have to look up where Tim Hortons is and then you have to go to.
And then, and then you like once you have that, then you go and so it's like, or I could say,
you go and so it's like, or I could say. That's what's my job, you know, it's like, well, I won't tell you go ask Bob. Bob will tell you your job. That's a level interaction, but in computer science we think of this as.
I can't decide whether a knee, it's going to refer to be or not or C or D So, like, virtual functions.
Finally, I notice a many to one relationship.
Exactly.
So I'm going to end with this, we're going to see this, this is.
There's a lot more to here, don't worry if you're a bit confused. This is just the beginning of this.
But just realize there's a lot of stuff here and if you haven't played with these ideas, it's going to take some time and that's what the tutorials are for.