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;
[case 2: root is user]
# cat /etc/user_attr | grep ^root;

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.

Stanley Huang