Friday, August 28, 2009

[Level 1] Switch between user and role in OpenSolaris.

As we know, when we add a new user during OpenSolaris installation wizards, then installer will switch "root" from user to role. And we cannot login the system with role "root".
How can we switch root from user to role, after that, how can we switch back?
You can use the command below:

0. how to verify root is user or role:
[case 1: root is role]
# cat /etc/user_attr | grep ^root;
root::::type=role;auths=solaris.*,solaris.grant;profiles=All;lock_after_retries=no;clearance=admin_high;min_label=admin_low
[case 2: root is user]
# cat /etc/user_attr | grep ^root;
root::::type=normal;auths=solaris.*,solaris.grant;profiles=All;lock_after_retries=no;clearance=admin_high;min_label=admin_low

1. Change root from role to user:
# rolemod -K type=normal root;

2. Change root from user to role:
# usermod -K type=role root;

Wish this helps.

regards,
Stanley Huang