You are logged in to a Solaris 11 system as user jack. You issue the following sequence of commands:
Identify two correct statements.
A.
You have the effective privilege of the account root.
B.
Your GID is 10.
C.
Your home directory is /root.
D.
You are running the shell specified for the account root.
E.
Your UID is 1.
Explanation:
Oracle Solaris provides predefined rights profiles. These profiles, listed in the
/etc/security/prof_attr, can be assigned by the root role to any account. The root role is assigned
all privileges and all authorizations, so can perform all tasks, just as root can when root is a user.
To perform administrative functions, you open a terminal and switch the user to root. In thatterminal, you can then perform all administrative functions.
$ su – root
Password: Type root password
#
When you exit the shell, root capabilities are no longer in effect.
Reference: User Accounts, Roles, and Rights Profiles
AD
-bash-4.1$ pwd
/export/home/ishush
-bash-4.1$ id
uid=60006(ishush) gid=10(staff)
-bash-4.1$ su
Password:
# id
uid=0(root) gid=0(root)
# pwd
/export/home/ishush
A is correct but
D is incorrect because not use – after su so the SHELL remains jacks SHELL.
llaszlo@s11:~$ id
uid=100(llaszlo) gid=10(staff)
llaszlo@s11:~$ su
Password:
root@s11:~# pwd
/export/home/llaszlo
root@s11:~# env | grep HOME
HOME=/export/home/llaszlo
root@s11:~# env | grep SHELL
SHELL=/usr/bin/ksh
root@s11:~# exit
llaszlo@s11:~$ su –
Password:
Oracle Corporation SunOS 5.11 11.2 October 2014
You have new mail.
root@s11:~# env|grep SHELL
SHELL=/usr/bin/bash
really nice question 🙂 check the picture carefully…
after the su, it is still jack’s prompt at the beginning, so I assume that he misstyped the password, or pushed CTRL-C, however, there is no “su: Sorry” after it.
But.
If the prompt is jack’s, he cannot have the effective root rights, however his GID is 10.
Let’s assume, that this is a typo, which is usual in this dump, in that case I agree with Dupek, that A is correct, and D is wrong.
And all the others are wrong, so there is no two correct options I have to say in this case… strange 🙂 might be also a typo somewhere…
# prompt after su.
I think, switch is succeed but shell remain same, since su used and not su –
my guess is AB could be right ; having consideration of GID vs effective GID.
I say AD just like pal says:
user@solaris11:~$ ps -p $$
PID TTY TIME CMD
5796 pts/1 0:00 ksh93
user@solaris11:~$ su
Password:
root@solaris11:~# id
uid=0(root) gid=0(root)
root@solaris11:~# ps -p $$
PID TTY TIME CMD
5807 pts/1 0:00 bash
root@solaris11:~# whoami
root
root@solaris11:~# who am i
user pts/1 Sep 23 23:48 (:0.0)
root@solaris11:~# cd
root@solaris11:~# pwd
/export/home/user
root@solaris11:~#