Check out a free preview of the full Full Stack for Front-End Engineers, v2 course:
The "Server Setup" Lesson is part of the full, Full Stack for Front-End Engineers, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Jem demonstrates how to update the apt command line tool, how to upgrade it, and how to add a new user to the server.

Get Unlimited Access Now

Transcript from the "Server Setup" Lesson

>> Jem Young: Now we're on part three, let's set up that server. So while the name changes are propagating across the Internet, let's set up our servers so it can actually handle some requests now.
>> Jem Young: Essentially, the steps are, we're gonna update the software. We want to create a new user who's not root.

[00:00:15] We want to make that user a super user. We want to enable allow that user to be able to login so we don't have to login to the route and switch over. And then we want to disable root login. You always want to disable root login. There's never a need to login as root.

[00:00:28] It will only expose yourself to more attacks. If, I could say attacks, I'll call them attacks. There are people trying to log in but they're classified as attacks. And I list out the steps like this because the next bit is a lot of commands. So I'll go really slowly but it's all terminal from here.

[00:00:47] All right, first thing we wanna do is we want to update software. We're using ATP. If you're following tutorial on the Internet or have before, you're probably using apt get. APT is a wrapper around app get and app I think cash maybe. But it's a simpler way of doing abt.

[00:01:04] It's just think of NPM in terms of it's a software package of how to download software. So we're still a root at this point but let's go and update the software. So run apt update and then once a software is updated, it might take a minute. Run apt upgrade.

>> Speaker 2: So, I exited out of root a while ago.
>> Jem Young: Just, yeah. So log back into your server,
>> Jem Young: And the way to get out of a server is exit. And if you switch user, you can exit and then exit again, so it's gonna drop you back to root and then you're gonna exit.

[00:01:37] So I'm gonna run those as well. First thing I'm gonna do is, I'm gonna log back in. I should also note that if you didn't know in the terminal, you can just go up or down to go back through your history. I will use that a lot if you're wondering how I type so fast is because I'm just traversing back up my history, and I'm just gonna login as roots, and I'm gonna run apt updates.

>> Jem Young: And updating all my software. And I'm gonna run apt upgrade, just to make sure I'm on the latest versions of things. And I'm gonna say, yes.
>> Jem Young: In general, you always want to keep your software up to date. In fact, who was it? So folks, I forget who there is just happened yesterday I was reading the news.

[00:02:33] There is a security provider that they, it was like the equivalent of Symantec Norton or something like that. They're one of the big names in security and they got hacked. Because their forum software was like two years out of date or I'm sorry, it wasn't two years, it was two days out of date.

[00:02:48] There's a vulnerability in the VB Bolton software they used for the forum. The forum got hacked because they didn't keep their software up to date. Almost all vulnerabilities you'll find are from, are not from like state actors or people determined to get into your software or determined to get to your server.

[00:03:04] It's because you have some software. That software communicates, the application communicates with the Internet. And those that application has vulnerabilities in it. So you always want to keep your software up to date. If I give you any security tip besides using SSH over a password. It's keeping your software up to date.

[00:03:21] You'll be fine most of the time. I'm gonna use the package maintainer's version. Because that way I can when I upgrade later it will be in sync with whatever they recommend versus whatever was installed based on the box.
>> Jem Young: And we should be good now. I started behind everybody and I'm done.

[00:03:40] So hopefully everybody else is done. We're gonna add a user. Normally this would require using, well we're already root so we don't have to do sudo or anything like that. All right, so let's think of a username you want to use. And we're gonna use the add the dash now.

[00:03:57] Add user, I'm just gonna say jem. You can use jem if you want. I'm not gonna be offended and create a new UNIX password. I'm gonna use something really short because we're gonna be typing a lot and we'll use another short one. You can leave it empty for this stuff, cool.

[00:04:19] So I did add user with the user name. I put in a password and then I just put in the blanks for everything else. You can put in the full name, root number if you want. It's your server. I'm not gonna tell you how to run it. Actually, I will tell you how to run it.

[00:04:33] That's literally what I'm doing now. But you can put in whatever you want for this part. It doesn't matter.