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.
Option A
B.
Option B
C.
Option C
D.
Option D
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 displayed.
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.