Chapter 4. Account Management

Table of Contents
Managing User Accounts
Managing User Groups
External User Authentication

Currently only the Sauron's Web Interface uses user accounts and privileges. A text-based interface (to be used via SSH or locally) is planned and will use the same user accounts and privileges as the web interface.

There are two ways to assign privileges to users either directly setting privileges to a user or assigning user to a user group and then setting privileges to that user group. It is recommended to use user groups to grant users privileges, since when there is large number of user accounts, it is much easier to modify permissions of a user group than having to modify each user's permission individually.

Warning

There is no access control when using the command-line utilities. Thus, it may be necessary protect access to the Sauron database (in PostgreSQL) and configuration file config (if it contains password to access the database).

Managing User Accounts

For managing user accounts there are several command-line utilities: adduser, moduser, and deluser. Following sections show how to do basic administrative tasks using these utilities.

Creating User

User accounts are created using adduser utility. This utility allows adding user accounts either interactively or in batch mode by specifying all the required information on command-line. Following example shows how to add normal user account interactively (see the Section called adduser in Chapter 6 for information how to use this command in non-interactive mode). To add new user into Sauron simply run adduser command from Sauron top-level directory:
        ./adduser
      
When started without any arguments (or without --user and --passwd option), interactive mode is started. Below is an example session how to add an account:
Enter username: pippin
Enter group name (empty for none): hobbits
Enter user description (full name): Peregrin Took
Enter user email address: pippin@shire.middle.earth
Enter optional user info: 
Enter account expiration date (dd-mm-yyyy, +<n>d, +<n>y) [none]: 
Enter password [UtH4RCda]: 
           Username: pippin
              Group: hobbits (GID=1)
           Longname: Peregrin Took
              email: pippin@shire.middle.earth
            comment: 
         expiration: <none>
          superuser: false
Add this user [y/n]?y
User pippin added successfully.
      
When creating account and not setting group for that account, adduser will remind that some privileges should be set for the user, before account can be used. This is not the case when assigning user to a group, since it's assumed that group contains necessary privileges for the account. See the Section called Setting Privileges for more information about user privileges and how to modify them.

Setting Privileges

Accounts must have some privileges (except superuser/administrator accounts) for them to be useful. Privileges can be assigned directly to the user account using moduser utility or indirectly to a group using modgroup utility.

Typically user (or group) is assigned one or more "server" privileges that grant user read-only access into those server(s). Then user is assigned "zone" privileges that grant user access into all hosts inside certain zone(s). If needed, user's access into all hosts inside the zone(s) user has write access can be further limited by assigning restrictive privileges to limit users access to only a subset of hosts inside the zone(s). For this there are rules to limit access by hostname (regexp) or by IP number (either by network/subnet or by IP-mask). See Table 4-1 for complete list of available user/group privileges.

In addition to modifying the user account itself, moduser utility can also be used to modify user privileges. To add privileges interactively for given account, just invoke moduser with --add option. For example:
      ./moduser pippin --add
      
After adding privileges to a user, moduser utility can be also used to display user's current privileges by giving only a username as argument. For example:
      ./moduser pippin
      
This should produce output similar to below displaying account details and privileges.
           Username: pippin (id=2)
           longname: Peregrin Took
              email: pippin@shire.middle.earth
               info: 
          superuser: No
              group: hobbits (gid=1)
      passwd status: valid (CRYPT)
         last login: 
 account expiration: <never>
    account created: Sat Feb 15 00:18:40 2003 by tjko    
      last modified: <never>

ID     Type     Ref.                      Mode
------ -------- ------------------------- --------------------------------
[User privileges]
3      hostname \.shire$                  (hostname constraint)

[Group (hobbits) privileges]
1      server   test                      R
2      zone     test:middle.earth         RW