Since we know how to manage user account, now it's time to learn about how do we switch users and how
do we allow pseudo access to user.
What is a pseudo access?
It's basically a command which allows an ordinary user to run root level commands the commands that
you could run to switch from one user to another as simply as you space dash based as username.
And then it will ask you for the username password.
You enter that and you become that user.
The next command is the sudo command.
This is how you run the command.
If you do not have root privileges or you cannot become root, but you still need to run certain commands.
Then you were on sudo was followed by the command and then the last command is v sudo by sudo edit the
etsi sudo file, which is a configuration file that allows user to add or remove the rights to run certain
commands.
And the file is ETSI solder.
If you remember at the beginning we talked about file structure and we talked about the ETSI at C is
the is the folder or directory in Linux where all the configuration files are stored.
Now let's look at these commands one by one by logging into our Linux machine, and this time we will
log into our Linux machine through the putty.
First, we need to find out what is the IP address of our lengths machine.
Clear this out.
And the command to check the IP address of your linux machine is if config you hit enter and the IP
address is right here.
This.
This is the primary interface that is used to communicate the computers.
This is the local interface.
You could note that and this is another interface you can ignore that is for private communication.
So focus on this one.
Open up your terminal.
And type in the IP address.
1i2 168 56.101.
Enter put in the username and password.
Once we were logged in, we could simply minimize this console access.
Now we will be using the putty.
To make this a little bigger.
Okay.
So we logged in as ourself.
Now what if you wanted to become another user?
So you do su dash spiderman.
It will ask you for the password and then you become Spiderman.
Let's exit out.
Go back to our account.
What if you wanted to become root simply to eschew dash, which we have covered many times.
Enter the password and you become root.
When you are root and from this level you want to switch to a different user.
Let's say Spiderman, then it will not ask you for the password because superuser or root account is
very powerful.
That does not need any other password to be authenticated.
We are.
Spiderman.
Let's go back.
We are now root.
Let's go.
One step back.
Exit out and we are.
So let's clear this out.
Next command we will learn as sudo.
Sudo is the command that is used to run a different command that is only owned or only has permissions
by root to run them.
For example, one of the command is DMI code.
You were on that.
That will give you permission denied because we cannot run that command.
Another command would be, for example, f disk to check check the disk size.
It will give you the permission denied as well, because we do not have the right again.
Who am I?
We are ourselves.
So how do we get the permission without becoming root?
Well, only root can allow that.
I could become root here and run the command.
So ask you to root and hit enter.
Now I'm root and the command that I will run to add a group to ATC pseudo file is vi sc pseudo for here
you need to look for the group name of veal.
Veal is the group that is automatically by default added to this file.
If you go down, we're coming down.
Remember to come down.
When you are in VI mode, you come down, you use your up right key, bottom key and there you go.
So this is the veal.
And it tells you this group allows people in group veal to run all commands.
So all we need to do is to add, I have salt into the veal group and it will allow all users, whoever
in veal group to run all commands.
So it's already added there.
We don't have to modify the solver.
If you wanted to add a new group or if you wanted to add a new user, then you would change that to
allow run all the commands.
Let's say if you want if you want to add absol to run all use a command, then you would put it right
here.
You put I saw all dash, all tab and then you will run pseudo command and you could become root.
Rights to run any command.
But we don't want to go at the user level.
We want we will stay at the group level.
So what I will do, I'll delete this line to delete a line is dead and then I'll save the file.
Now we know that we need to add user to real groups, so to add a user is user mod minus g.
And the command is which group is real and which user is.
Enter.
How do you verify you grab real from etsy group?
Because group is the file that manages that user and manages all the groups.
And you'll see right here now I am part of the group real.
So if I become myself Etsy, I have all my I myself.
So if I become myself now, if I run through DMI code, it will ask me for the first time password.
Okay.
So the command that I typed was wrong.
So it would DMI not DMI decode.
Sorry about that.
There you go.
See, now the command is running.
What if you run this command just without Zulu?
It's not going to run.
You have to run the command Zulu, followed by the DMI DX code, and that's how it will run.
You can also run the second command sudo f disk, which will tell you the size of your disk.
And here it will tell you your size of the disk is 10.7 gig and all the partition information, all
that.
You could only view that information only if you are root.
So this is how we do switch user from one user to another and we add a user to become a powerful user
or run powerful command that it only owned by root.