skip book previous and next navigation links
go up to top of book: HP OpenVMS System Manager's Manual, Volume 1:... HP OpenVMS System Manager's Manual, Volume 1:...
go to beginning of chapter: Managing User Accounts Managing User Accounts
go to previous page: Adding User Accounts Adding User Accounts
go to next page: Restricting the Use of AccountsRestricting the Use of Accounts
end of book navigation links

Maintaining User Accounts  



As system manager, you perform a certain number of user account maintenance tasks, such as modifying and deleting accounts. The following sections explain how to perform these tasks:

Task Section
Using command procedures for interactive accounts
Using Command Procedures for Interactive Accounts
Modifying a user account
Modifying a User Account
Listing user accounts
Listing User Accounts
Maintaining the user environment
Maintaining the User Environment
Deleting a user account
Deleting a User Account
Using BACKUP to remove user files
Using BACKUP to Remove User Files
Disabling a user account
Disabling a User Account

Using Command Procedures for Interactive Accounts  

For all accounts, login command procedures contain commands commonly executed at the beginning of every user session. These commands do such tasks as the following ones:

Login command procedures are useful for saving keystrokes and standardizing operations.

In establishing login command procedures for interactive accounts, you have the following choices:

Login Command Procedure Description
System
As system manager, you normally create and maintain a standard login command procedure in the system directory (the file is usually named SYS$MANAGER:SYLOGIN.COM). You then assign the logical name SYS$SYLOGIN to the name of the file so that whenever a user logs in, the procedure is executed.
Individual
For any or all accounts, you can specify an additional login command procedure with the /LGICMD qualifier of the AUTHORIZE commands ADD, MODIFY, or COPY. You can give the login command procedure any valid file specification. Whenever the user logs in, the additional procedure is executed after SYS$SYLOGIN.
User-specified command file
If system (and, optionally, individual) login command procedures are not implemented, the system looks for a command file called LOGIN.COM in the user's login directory as defined by the UAF (user authorization file) record device and directory fields. If the file is found, the system executes it. The user develops and maintains this command file, which should follow these conventions:
  • Device and directory names must take the default file specification for the account.


  • The file name and file type must be LOGIN.COM.


You can provide an aid to new users by copying a login command procedure template into newly created top-level directories. However, to ensure proper ownership of the file, change the owner UIC (user identification code) of the file to that of the user. Make this change with the DCL command SET FILE/OWNER.

Sample Systemwide SYS$MANAGER:SYLOGIN.COM Login Command Procedure illustrates typical systemwide login command procedures.
Example 1  Sample Systemwide SYS$MANAGER:SYLOGIN.COM Login Command Procedure   
$ V = F$VERIFY(0)
$START:
$ !
$ SET NOCONTROL=Y         ! Do not allow Ctrl/Y to exit procedure
$ SET NOON
$ !
$ !     Allow network jobs to start faster
$ !
$ IF F$MODE() .EQS. "NETWORK" THEN GOTO EXIT
$ !
$ !     Enable Ctrl/T handling by DCL
$ !
$ SET CONTROL=T
$ !
$ !     Define Foreign Commands For Installed Utilities
$ !
$ USERS             ==    "SHOW USERS"
$ DISPLAY           ==    "MONITOR PROCESSES/TOPCPU"
$ INFO              ==    "SHOW PROCESS/CONTINUOUS"
$ SUSPEND           ==    "SET PROCESS/SUSPEND"
$ RESUME            ==    "SET PROCESS/RESUME"
$ SETNAME           ==    "SET PROCESS/NAME"
$ !
$ !     Define a symbol indicating whether the terminal
$ !     is on a dialup port
$ !
$ TT == F$GETDVI("TT","DEVNAM")-"_"
$ DIALUP == ( (TT .GES. "TTG0:" .AND. TT .LES. "TTG4:") -
        .OR. (TT .GES. "TTH1:" .AND. TT .LES. "TTH4:") -
        .OR. (TT .EQS. "TTI5:") )
$ IF DIALUP THEN SET TERMINAL/INQUIRE
$ !
$EXIT:
$ IF V THEN SET VERIFY
.
.
.
$ SET CONTROL=Y
$ EXIT


As the example shows, you can disable the Ctrl/Y function (which suspends execution of the current image and invokes the command interpreter) to force execution of the complete login command procedure whenever the user logs in. Do this with the DCL command SET NOCONTROL=Y. Before the login command procedure exits, add the DCL command that resets the Ctrl/Y function (SET CONTROL=Y).

Sample Login Command Procedure (LOGIN.COM) for a User Account shows typical abbreviations and symbols that a user might define in a login file.
Example 2  Sample Login Command Procedure (LOGIN.COM) for a User Account  
$ SET NOON
$ SET PROTECTION=(S=RD,O=RWED,G=R,W=R)/DEFAULT
$ !
$ ! Define abbreviations for often used commands
$ !
$ DIR*ECTORY    ==     DIRECTORY/DATE/SIZE
$ PU*RGE        ==     PURGE/LOG
$ DE*LETE       ==     DELETE/LOG/CONFIRM
$ !
$ !
$ ! Other useful abbreviations
$ !
$ SHP           ==     "SHOW PROCESS/PRIVILEGES"
$ PRI*NT        ==     "PRINT/NOTIFY"
$ SHD           ==     "SHOW DEFAULT"
$ UP            ==     "SET DEFAULT [-]"
$ SP            ==     "SET PROCESS/PRIVILEGES="
$ SQ            ==     "SHOW QUEUE/BATCH/ALL/DEVICE"
$ H*OME         ==     "SET DEFAULT SYS$LOGIN"
$ SUB*MIT       ==     "SUBMIT/NOTIFY"
$ SYS           ==     "SHOW SYSTEM"
$ DAY           ==     "SHOW TIME"
$ !
$ ! Set /LOG for all commands
$ !
$ BACK*UP       ==     "BACKUP/LOG"
$ DEL*ETE       ==     "DELETE/LOG"
$ LIB*RARY      ==     "LIBRARY/LOG"
$ PUR*GE        ==     "PURGE/LOG"
$ REN*AME       ==     "RENAME/LOG"
$ !
$ ! End of LOGIN.COM processing
$ !
$ GOTO 'F$MODE()
$NETWORK:
$ EXIT
$INTERACTIVE:
$ VN            ==     "SET TERMINAL/WIDTH=80"
$ VW            ==     "SET TERMINAL/WIDTH=132"
$ EXPERT        ==     "SET MESSAGE/NOFACIL/NOSEVER/NOIDENT"
$ NOVICE        ==     "SET MESSAGE/FACILITY/SEVERITY/IDENTIF"
$ NOVICE
$ !
$ ! Symbols for network users
$ !
$ SYSA          ==     "SET HOST SYSA"
$ SYSB          ==     "SET HOST SYSB"
$ SYSC          ==     "SET HOST SYSC"
$ EXIT                             ! End of interactive login
$BATCH:
$ SET VERIFY                       ! End of batch login
$ EXIT


Using Logout Command Procedures

The system does not provide for automatic execution of a command procedure at logout time. However, you can supply one as follows.

How to Perform This Task

  1. Create a systemwide logout command procedure that executes whenever a user logs out. (The file is usually named SYS$MANAGER:SYLOGOUT.COM.)
  2. To ensure that this command procedure executes, include a command in SYS$MANAGER:SYLOGIN.COM that equates the most commonly used abbreviation of the LOGOUT command (often LO) to the execution of the logout command procedure.

Example

$ LO*GOUT:==@SYS$MANAGER:SYLOGOUT
The last line of the logout command procedure then uses an alternate form of the LOGOUT command, such as a LOGOUTNOW command. (You can create any command name you like beginning with LO.) You cannot use the same abbreviation as used for the symbol (in this case LO) because it will start the procedure again. As an alternative, you could add the following command, just above the last line:
$ DELETE/SYMBOL/GLOBAL LOGOUT
Note that this technique works in some situations but it is not foolproof; there are many alternative ways to terminate a process.

Modifying a User Account  

To change a user account's quotas, default directory, password, authorized privileges, or any other characteristics assigned by AUTHORIZE, use the MODIFY command. You can use the MODIFY command to change any field in an existing user account. However, a user must log out and log in again for the modifications to take effect.

Examples

  1. When a user forgets a password and cannot log in, use the AUTHORIZE command MODIFY/GENERATE_PASSWORD to reset a user password. For example, the following command generates a new password for user WELCH:
    UAF> MODIFY WELCH/GENERATE_PASSWORD
    By default, after logging in, user WELCH must change the password.
  2. Any changes that you make to a user's record will take effect after the user next logs in. For example, suppose that user JONES currently has an open file quota (FILLM) of 20. To increase user Jones' open file limit to 40, you would use the following command in AUTHORIZE:
    UAF> MODIFY JONES/FILLM=40
    Any process of user JONES that is logged in at the time that you modify the user authorization file continues to have a file limit of 20. In order to have an open file limit of 40, user JONES must log out and then log in again, after you have made the modification to the user authorization file (UAF) using AUTHORIZE.

Listing User Accounts  

Use the AUTHORIZE command LIST to create the file SYSUAF.LIS, containing a summary of all user records in the UAF. By default, the LIST command produces a brief report containing the following information from the UAF:

Use the /FULL qualifier to create a full report of all the information (except user passwords) contained within the UAF.

Example

The following example writes a brief report of the UAF to the output file SYSUAF.LIS:

UAF> LIST
%UAF-I-LSTMSG1, writing listing file
%UAF-I-LSTMSG2, listing file SYSUAF.LIS complete
The system displays the same messages when you use the /FULL qualifier. However, a full report is written to the output file.

Maintaining the User Environment  

As the work requirements of your system change, you might have to perform the following tasks:

With the Authorize utility, you can perform these maintenance operations by modifying or deleting records in the UAF.

Creating Additional Default Record Templates

On systems where all users perform the same type of work, you typically use the system-supplied default record, DEFAULT, as the template for adding new user records. You might find, however, that your system supports several different user categories, each category performing a specific type of work and requiring unique record attributes. Instead of always using the system-supplied default record as a template and making numerous changes each time you add a user record, you can create additional default UAF records to serve as templates for each user category.

Before you create additional default records, you must make the following decisions:

How to Perform This Task

Once you define a user category and establish which record attributes are needed, you can create the default record.

Examples

  1. The following command creates a default record for a category of user that requires a special captive account:
    UAF> ADD DEFAULT2/LGICMD=ALT_COM_PROC/FLAGS=CAPTIVE -
    _UAF> /DEVICE=USER3:/DIRECTORY=[PRODUCT]
    The command in this example uses the system-supplied default record DEFAULT to create the record DEFAULT2 and changes the LGICMD, login flags, default device, and default directory fields.
  2. You can then use the AUTHORIZE command COPY to create additional records having the same attributes as DEFAULT2. The COPY command creates a new UAF record that uses the specified default record except where you explicitly override field values.
    UAF> COPY DEFAULT2 PALOOKA/PASSWORD=W7YA84MI/UIC=[360,114]
    This example uses DEFAULT2 as a template to create a duplicate record for the user PALOOKA. Notice that only the password and UIC values are changed.

Deleting a User Account  

The main problem in deleting an account, especially an interactive or restricted account, is deleting the files used by the account.

How to Perform This Task

The following steps are suggested:

  1. Copy (or have the outgoing user of the account copy) any files of value to the ownership of another account. Be sure to change the owner UIC of the files to match the owner UIC of the new owner. You can also use the Backup utility (BACKUP) to save the files to a backup tape or disk.
  2. Change the password and log in as a user of that account if you are working from a nonprivileged account. This avoids inadvertently deleting files that might point to other files of different ownership.
  3. Delete the account's files and directories from the deepest level up to the top level, using the following procedure:

    1. Locate and examine all subdirectories using the DCL command DIRECTORY [directory-spec...], where directory-spec is the name of the account's default directory.
    2. Delete the files in each subdirectory, and then delete the subdirectory. Note that directory files are protected against owner deletion; therefore, you must change the protection before deleting directory files.
    3. Delete the account's top-level directory. The command procedure in the next example deletes an account's files from the bottom level up. Do not, however, execute this command procedure from a privileged account.
  4. Exit from the user account and return to a privileged account. Remove the user's account, using the Authorize utility (AUTHORIZE).

    When you run AUTHORIZE to remove a user's UAF record, AUTHORIZE also removes the user's connections as a holder of identifiers in the rights database. However, if a departed user is the only remaining holder of a given identifier, remove that identifier to avoid future confusion. See the OpenVMS Guide to System Security .
  5. Remove the user's disk quota entry from the disk quota file, if one existed, with SYSMAN.
  6. Remove associated mail information by entering the MAIL command REMOVE username. (See the OpenVMS User's Manual for more information.)

The command procedure template in Command Procedure Template for Deleting an Account's Files deletes an account's files.


NoteDo not execute this command procedure from a privileged account.

Example 3  Command Procedure Template for Deleting an Account's Files  
$ !     DELTREE.COM - deletes a complete directory tree
$ !
$ !     P1 = pathname of root of tree to delete
$ !
$ !     All files and directories in the tree, including
$ !     the named root, are deleted.
$ !
$ IF "''DELTREE'" .EQS. "" THEN DELTREE = "@SYS$LIBRARY:DELTREE"$ ON CONTROL_Y THEN GOTO DONE
$ ON WARNING THEN GOTO DONE
$ DEFAULT = F$LOGICAL("SYS$DISK") + F$DIRECTORY()
$10:
$ IF P1 .NES. "" THEN GOTO 20
$ INQUIRE P1 "Root"$ GOTO 10
$20:
$ IF F$PARSE(P1) .EQS. "" THEN OPEN FILE 'P1'
$ SET DEFAULT 'P1'
$LOOP:
$ FILESPEC = F$SEARCH("*.DIR;1")
$ IF FILESPEC .EQS. "" THEN GOTO LOOPEND
$ DELTREE [.'F$PARSE(FILESPEC,,,"NAME")']
$ GOTO LOOP
$LOOPEND:
$ IF F$SEARCH("*.*;*") .NES. "" THEN DELETE *.*;*
$ DIR = (F$DIRECTORY()-"]"-">")-F$PARSE("[-]",,,-
         "DIRECTORY")-"]"-">")-"."-"["-"<"$ SET PROTECTION=WORLD:RWED [-]'DIR'.DIR;1
$ DELETE [-]'DIR'.DIR;1
$DONE:
$ SET DEFAULT 'DEFAULT'


Using BACKUP to Remove User Files  

If each user has a unique UIC, you can use the Backup utility (BACKUP) to remove the user's files, even if the files are scattered throughout the directory structure. See the Backup utility section in the HP OpenVMS System Management Utilities Reference Manual for more information.

Examples

  1. The following example of a BACKUP command is used to remove files:
    $ BACKUP/DELETE PUBLIC:[...]/BY_OWNER=[21,103] MTA0:PUBLICUIC.SAV
    This BACKUP command copies and deletes only those files owned by the specified UIC on disk PUBLIC. The files are copied into a save set named PUBLICUIC.SAV on device MTA0. Note that the BACKUP/DELETE command does not delete the directory files (file type .DIR) for the account. )
  2. To recover lost files, enter the ANALYZE/DISK_STRUCTURE command in the following format:ANALYZE/DISK_STRUCTURE/REPAIR/CONFIRM device-name:See Recovering Lost Files for a complete description of how to recover lost files. See the HP OpenVMS System Management Utilities Reference Manual for information on using the Analyze/Disk_Structure utility.

Disabling a User Account  

To disable an account without deleting it, set the disable user flag (/FLAGS=DISUSER) using AUTHORIZE. If the user is logged in, the account is disabled only after the user logs out.


go to previous page: Adding User Accounts Adding User Accounts
go to next page: Restricting the Use of AccountsRestricting the Use of Accounts