Administering Users and Groups


Unless you're using your Unix system as a personal workstation, you're going to want to give other people access to the system by creating user accounts and grouping them.

If your users are consuming disk space at an unreasonable pace, you can also consider turning on disk quotas to limit their disk usage before they fill your hard drive. Refer to your OS documentation for more information about activating and controlling quotas.

To add a new group (Fedora Core)

Fedora Core's graphical User Manager can be used to add, delete, and edit groups.

1.

Launch the User Manager by clicking the red hat icon in the top left of the Fedora desktop to display the menu, the System Settings item in the menu to display the settings submenu, and then the Users and Groups item in the settings menu.

The system displays a Query dialog asking for the root password (Figure 3.4).

Figure 3.4. In the Query dialog, Fedora Core asks for authentication with the root password.


2.

Enter the root password and click OK to continue, or click Cancel to stop loading the User Manager.

The system loads the User Manager (Figure 3.5).

Figure 3.5. Fedora Core's User Manager application.


3.

Click the Add Group toolbar icon.

The User Manager displays the Create New Group dialog (Figure 3.6).

Figure 3.6. Creating a new group with the User Manager.


4.

Enter a name for the new group in the Group Name field.

5.

If you need to specify an ID for the group, check the "Specify group ID manually" box and enter the group's ID (GID) in the GID field. If you don't specify a GID, an unused one will be assigned.

6.

Click OK to create the new group.

To add a new user (Fedora Core)

With a name like the User Manager, you'd expect it to also be able to add users.

1.

Launch the User Manager by clicking the red hat icon, the System Settings menu item, and then the Users and Groups item.

The system displays a Query dialog asking for the root password (Figure 3.4).

2.

Enter the root password and click OK to continue, or click Cancel to stop loading the User Manager.

The system loads the User Manager (Figure 3.5).

3.

Click the Add User toolbar icon.

The User Manager displays the Create New User dialog (Figure 3.7).

Figure 3.7. Creating a new user with the User Manager.


4.

Enter a name for the new user in the User Name field.

5.

Enter the user's full name in the Full Name field.

6.

Enter the user's password in the Password field. Enter it again in the Confirm Password field to make sure you've entered it properly.

7.

Select a default shell for the user from the Login Shell pop-up menu. This lists all of the shells available on the system. The default, /bin/bash, is an excellent choice, although some people will have other preferences.

8.

To create the user's home directory automatically, check the "Create home directory" box; otherwise you will have to create the directory by hand or use an existing directory. Enter the path to the user's home directory in the Home Directory field.

9.

Check the "Create a private group for the user" box if you want each user to have his or her own private group. This is a security measure.

10.

To specify a user ID (UID) for the new user, check the "Specify user ID manually" box and enter the user ID in the UID field. If you don't specify a UID, an unused one will be assigned to the new user.

11.

Click OK to create the new user.

To add a new group (FreeBSD)

Like most configuration changes in FreeBSD, adding a new group is done through the sysinstall interface.

1.

Log in as root.

2.

sysinstall

Launch the sysinstall tool (Figure 3.8). You'll recognize this from when you installed FreeBSD.

Figure 3.8. The sysinstall tool lets you change much of FreeBSD's configuration, including adding new users and groups.


3.

Use the down arrow key to select Configure, then press Enter to continue.

The sysinstall tool displays the FreeBSD Configuration Menu (Figure 3.9).

Figure 3.9. The FreeBSD Configuration Menu in sysinstall.


4.

Use the down arrow key to select User Management, then press Enter to continue.

The sysinstall tool displays the "User and group management" dialog (Figure 3.10).

Figure 3.10. The "User and group management" dialog lets you create new users and groups.


5.

Press the down arrow key to select Group, then press Enter.

6.

The installer displays the "Add a new group" pane (Figure 3.11).

Figure 3.11. Adding a new group.


7.

Enter the new group's information:

Group name The name of the new group.

GID Group ID (GID); you can leave the default alone unless you need to create a group with a specific GID.

Group members A list of users that belong to this new group; you can leave this blank.

Press Tab to select OK, and press Enter to return to the "User and group management" dialog (Figure 3.10).

8.

Press the up arrow key to select Exit, then press Enter to return to the FreeBSD Configuration Menu screen.

9.

Press the up arrow key to select Exit, then press Enter to return to the sysinstall main menu.

10.

Press X to exit sysinstall.

To add a new user (FreeBSD)

The sysinstall tool's "User and group management" dialog is also used to create new users.

1.

Log in as root.

2.

sysinstall

Launch the sysinstall tool (Figure 3.8). You'll recognize this from when you installed FreeBSD.

3.

Use the down arrow key to select Configure, then press Enter to continue.

The sysinstall tool displays the FreeBSD Configuration Menu (Figure 3.9).

4.

Use the down arrow key to select User Management, then press Enter to continue.

The sysinstall tool displays the "User and group management" dialog (Figure 3.10).

5.

Select User, then press Enter.

The installer displays the "Add a new user" pane (Figure 3.12).

Figure 3.12. Adding a new user.


6.

Enter the new user's information:

Login ID The account's login name.

UID User ID; you can leave the default alone. Figure 3.12 shows a new user getting a UID of 1001, the same as the ID of the group we made in the previous task, "To add a new group (FreeBSD)". That's OK, if a little confusing, because the user IDs and group IDs come from different pools and can overlap without causing problems.

Group Group ID; enter 1001 here, for the users group we just created.

Password The user's initial password.

Full name The user's full name; you can include other useful information (phone extension, and so on) here as well, if there's room (63 characters will fit).

Member groups Other groups this user will belong to; you can leave this blank.

Home directory The user's home directory; you can use the default unless you need the user's home to be somewhere else.

Login shell The shell this user will use by default; use the default.

7.

Select OK and press Enter to return to the "User and group management" dialog (Figure 3.10).

8.

Select Exit, then press Enter.

To add a new group (Windows with Cygwin)

  • To add a new group to Cygwin, you need to create it first using the Windows User Accounts control panel or the Computer Management administrative tool. Refer to your Windows documentation for more information about how to use those tools.

     mkgroup -l -g name >> /etc/group 

    Adds information about the group specified by name to the /etc/group file, for use with Cygwin.

    The -l option means local groups only (if you're on a domain, use -d instead), and -g is to display information for the specified group only. Without the -g option, mkgroup would print information about all known groups.

To add a new user (Windows with Cygwin)

  • To add a new user to Cygwin, you create it with the User Accounts control panel or the Computer Management administrative tool. Then open a Cygwin window and use the mkpasswd command to add the new user name to the /etc/passwd file:

     mkpasswd -l -u name >> /etc/passwd 

    The -l option means local users only (if you're on a domain, use -d instead), and -u is to display information for the specified user only. Without the -u option, mkpasswd would print information about all known users.

To add a new group (Mac OS X)

The NetInfo Manager handles groups on Mac OS X, providing a graphical interface for creating, deleting, and modifying groups.

1.

Launch the NetInfo Manager, found in /Applications/Utilities on your boot volume.

The system starts the NetInfo Manager, with a view of your local information tree (Figure 3.13).

Figure 3.13. Apple's NetInfo Manager handles a database of information that other Unix variants store in text files in /etc.


2.

Click the lock icon in the lower-left corner; this lets you make changes to the NetInfo database.

NetInfo displays a dialog asking you for the user ID and password for an administrator's account (Figure 3.14).

Figure 3.14. Logging in as an administrator to modify NetInfo's database.


3.

Enter the user ID and password for an administrator's account, then click OK or press Enter to continue.

4.

Click the groups entry in NetInfo's second column.

NetInfo displays the available groups (Figure 3.15).

Figure 3.15. NetInfo shows you the existing groups.


5.

Click the New icon in the toolbar.

NetInfo creates a new entry in the groups list named new_directory (Figure 3.16).

Figure 3.16. Creating a new group in NetInfo.


6.

Double-click the name property's value (currently new_directory) to change it to an editable field. Enter the name of your new group.

7.

Choose New Property from NetInfo's Directory menu to create a new property.

8.

Double-click new_property in the property list and change it to password. Now do the same to change new_value to * (an asterisk).

9.

Create another new property, named gid, and set its value to an unused group ID. You may need to look at /etc/group or the existing group entries to see which IDs are already used. Starting with 1001 seems like a safe bet.

10.

Choose Save Changes from the Domain menu to create your new group.

NetInfo displays a confirmation dialog (Figure 3.17).

Figure 3.17. Confirming your changes to NetInfo's database.


11.

Click the "Update this copy" button in the confirmation dialog to save your changes.

To add a new user (Mac OS X)

  • In Mac OS X, you use the Accounts pane of System Preferences to create new users.

    No additional intervention is required. Please refer to your Mac OS X documentation for information about using the Accounts pane.



    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net