Search
Translations of this page:

Managing Users

Creating Groups

Solaris Users are always a member of one or more groups. You want to create groups so that a set of users can share the same permissions across different files. One such example is to create a “web” group for all files relating to a website. To create a new group:

sudo groupadd <groupname>

Assuming your account is “admin”, you will be asked for the password to that account. Once the password is accepted, the group is created and there will be no output to the console.

You will be able to verify that the group has been created by:

grep <groupname> /etc/group

Where groupname is the name you used in the initial groupadd command.

Creating Users

You can add new users with the following command:

sudo useradd -d /home/<username> -m -g <group> -s /usr/bin/bash <username>

Where you replace <username> with the user name for the new user and <group> with the primary group for the new user.

You can set the password for the new user with the following command:

sudo passwd <username>

Adding Users to Groups

To redefine a user's primary group membership:

sudo usermod -g <groupname> <username>

The following commmand will redefine the given user's supplemental group membership:

sudo usermod -G <groupname> <username>

If you want a user to be able to use sudo ensure the user is in the 'staff' group.

 
accelerators/kb/users.txt · Last modified: 2009/03/13 20:28 by jacques
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki