So, go ahead and bring up your terminal and in here we need to use a program or
command called
"adduser" and so we need to run this as root, so type "sudo adduser" and then the user
name of the account you want to create. So, I'm gonna create "nick2" Put in your
sudo password, now it's going to add the user, it's gonna add a group for the user, and then it's
also going to add the user to a group, and you know all this other stuff, and
then we need to set a password for this new account. So, type a password and you can also add
additional information about the accounts if you want to, if you don't
want to just hit enter through all these, and then hit "y" and enter.
Now we've got a new user account, so let's switch over to that account and have a
look. So, type "su nick2" we enter the new accounts password, and now you can see
what user we're using in terminal at the prompt. So, it's gonna say your username at
computer name, and also after here if we're in any directory it's gonna tell us what directory
we're in. We're still in the nickjermaine directory because that's our
main user account where we're coming from and that's the directory that we were
last in. So, if I type "sudo nano textfile" it's already added me to the sudo group, so
we don't even have to worry about that. Actually it hasn't, ok I was thinking
that's a bit weird because it shouldn't have, then it prompted for the password so I
assumed it did. So, this is exactly what we wanted to see. We're going to figure out
how to get nick2 into the sudo file. So, let's go ahead and switch back
over to our main account, so
enter your password, and then we're back in this account. In order to add nick2 to the
sudo file, it's really simple. Just type "sudo adduser nick2 sudo" So, basically
this command is the same as when we went to create the user except there's one
difference there is now a fourth parameter in the entire command. So, sudo,
let's mark that off we know what that does, add users the program we're using,
and then there's two additional parameters now. If there's only one it's gonna
assume that you're actually adding a user and that's all you're doing. If there's
two parameters what it's gonna do is it's going to add the first parameter to the
second one as if it was adding user to a group, and so that's exactly what this is
gonna do. This is gonna add the nick2 user to the sudo group so that it can use
sudo. So, just hit enter here and we're done. So, now we can switch back
over to that account and to demonstrate the sudo privileges it actually
already gave us a new message here
logging in as sudo for the first time. So, let's go ahead and use that comman and
make sure everything is working. So, "sudo touch textfile"
Good stuff. Now if we list the directory we've got textfile there, so now we can "sudo rm textfile"
then ls again and we're good to go.
So, that's how to add users to the account. In the next video actually we're going to
learn how to delete users, it's probably gonna be really short video. Thank you
guys for watching!