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:
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:
Define symbols
Assign logical names
Display messages and the time of day
Set terminal characteristics
Define keys to perform certain functions
Set process default file protection (SET PROTECTION/DEFAULT)
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.
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).
Create a systemwide
logout command procedure that executes whenever a user logs out.
(The file is usually named SYS$MANAGER:SYLOGOUT.COM.)
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.
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.
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.
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:
Account owner
User name
UIC
Account names
Privileges
Process priority
Default disk and directory
Use the /FULL qualifier to create a full report of all the
information (except user passwords) contained within the UAF.
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:
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.
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.
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.
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.
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.
Delete the account's files and directories from
the deepest level up to the top level, using the following procedure:
Locate and
examine all subdirectories using the DCL command DIRECTORY [directory-spec...], where directory-spec is the name of the account's default directory.
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.
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.
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
.
Remove the user's disk quota entry from the disk
quota file, if one existed, with SYSMAN.
Remove associated mail information by entering the
MAIL command REMOVE username. (See the OpenVMS User's Manual
for
more information.)
Do 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.
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. )
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.