Which option correctly represents the output?

You log in to the system as user1, then switch user to root by using the su – command. After
entering the correct password, yon enter the following commands:
whoami;who am i;id
Which option correctly represents the output?

You log in to the system as user1, then switch user to root by using the su – command. After
entering the correct password, yon enter the following commands:
whoami;who am i;id
Which option correctly represents the output?

A.
uid-0(root) gid=0(root)
user1 console Dec 30 20:20
root

B.
root
user1 console Dec 30 20:20
uid=0(root) gid=0(root)

C.
user1 console Dec 30 20:20
root
uid=0(root) gid=0(root)

D.
uid=0(root) gid=0(root)
root
user1 console Dec 30 20:20

Explanation:
* The whoami utility displays your effective user ID as a name.
Here this would be root.

* who am i
The command who shows who is logged on.
Here this would be:
user1 console Dec 30 20:20
* The id utility displays the user and group names and numeric IDs, of the
calling process, to the standard output. If the real and effective IDs
are different, both are displayed, otherwise only the real ID is dis-played.
Here this would be:
uid=0(root) gid=0(root)
Note:
Each UNIX proces has 3 UIDs associated to it. Superuser privilege is UID=0.Real UID——–This
is the UID of the user/process that created THIS process. It can be changed only if the running
process has EUID=0.Effective UID————-This UID is used to evaluate privileges of the process
to perform a particular action. EUID can be change either to RUID, or SUID if EUID!=0. If EUID=0,
it can be changed to anything.Saved UID———If the binary image file, that was launched has a
Set-UID bit on, SUID will be the UID of the owner of the file. Otherwise, SUID will be the RUID.



Leave a Reply 2

Your email address will not be published. Required fields are marked *