Previous Contents Index Documentation Resources Next |
Managing Servers With iPlanet Console |
Chapter 8Administration Server Command-Line Tools
The command-line tools (utilities) described in this chapter come with iPlanet Administration Server. You can use these utilities to configure an instance of Administration Server without launching iPlanet Console:This chapter tells you how to use the command-line tools.
The admconfig utility allows you to configure an instance of Administration Server using the command line instead of using the iPlanet Console graphical interface. Use admconfig to modify network, access, encryption, or directory settings. The utility is stored at serverRoot/bin/admin.
admconfig [options] task [args] [task2] [args] [task3] [args] ...
The options that you can use with admconfig are described in the section that follows. The tasks that you can perform with admconfig, as well as the arguments for those tasks, are described in "Tasks and Their Arguments."
An option is a general setting that affects how admconfig runs. You can specify an option using a complete command such as -user or an abbreviated command such as -u. When specifying a command, make sure to use enough characters to differentiate it from other commands.
Option commands are not case sensitive. For example, both -USER and -User are accepted as the -user command. You can use multiple option commands with the same invocation of admconfig. For example, the following option commands specify that admconfig should establish an encrypted connection with eastcoast.siroe.com on port 904.
-enc -ser eastcoast.siroe.com:904
A task specifies an operation that admconfig should perform. Some tasks take arguments, commands that provide information necessary to complete an operation.
You can specify a task using a complete command such as -restart or an abbreviated command such as -r. When specifying a task command, make sure to use enough characters to differentiate it from other commands. The task commands are not case sensitive. Both -RESTART and -Restart are accepted as the -restart task.
You can run multiple tasks with the same invocation of admconfig. If you use the -i[nputFile] option command to specify an input file, admconfig runs the tasks contained in that file first. The admconfig utility executes tasks in the order that they are specified in the input file and then in the order specified on the command line.
The following examples demonstrate different uses of admconfig.
This example changes the port number for an instance of Administration Server to 33333, and then restarts the instance. The verbose level option, which controls how much status information is printed to the screen, is set to 5.
This example retrieves the hosts from which connections are allowed. The verbose level option is set to 9 (the default value when a number isn't specified).
- admconfig -server eastcoast.siroe.com:22222 -user john:password -verbose 5 -setPort 33333 -restart
This example displays the help information for restarting an instance of Administration Server.
- admconfig -ser eastcoast.siroe.com:33333 -u john:password -verb -geth
- admconfig -h r
When your computer system's IP address changes, you must update the local Administration Server configuration file and the configuration directory. If you do not enter the new IP address in these locations, you will not be able to start the Administration Server.
A Perl script is provided to help you update these two configurations. The script changes the IP address for an instance of Administration Server in both the local.conf file and the configuration directory. The script is called admin_ip.pl and is stored in the serverRoot/shared/bin folder.
To run admin_ip.pl follow the instructions for UNIX Systems or Windows NT as appropriate:
On UNIX Systems
In the serverRoot/shared/bin folder, enteradmin_ip.pl Directory_Manager_DN Directory_Manager_password old_IP new_IP [port #]
The old IP address is saved in a file called local.conf.old.
On Windows NT
From the command line go to the serverRoot/shared/bin folder and enter../../install/perl admin_ip.pl Directory_Manager_DN Directory_Manager_password old_IP new_IP [port #]
The old IP address is saved in a file called local.conf.old.
ldapsearch, ldapmodify, and ldapdelete These tools allow you to search and modify the user directory. They are stored in the serverRoot/shared/bin folder. For detailed information about how to use these tools, see the iPlanet Directory Server Administrator's Guide.
The sec-activate tool is used to activate and deactivate SSL for an instance of Administration Server. The sec-activate program is stored in the serverRoot/bin/admin/admin/bin folder.
sec-activate serverRoot SSLEnabled
Enter information for the following variables:
serverRoot. The server root of the instance of Administration Server on which you want to activate or deactivate SSL.
sec-activate /usr/iplanet/server4 off
The sec-migrate tool migrates keys and certificates from a pre-4.0 Netscape server to a target iPlanet or Netscape 4.x server. Migrating keys and certificates is useful when you want to use a pre-4.0 SSL certificate with a new server. This tool allows you to use the existing pre-4.0 certificate and its key instead of obtaining a new certificate. The sec-migrate program is stored in the serverRoot/bin/admin/admin/bin directory.
sec-migrate src alias dist sie passwd
Enter information for the following variables:
alias. Alias of the old key database.
sie. Server instance entry: Name of the server instance to migrate key and certificate information to.
passwd. Password used to generate pre-4.0 key database.
The modutil tool is a command-line utility for managing PKCS #11 module information stored in secmod.db files or hardware tokens. You can use the tool to perform the following operations:
Adding and deleting PKCS #11 modules
Security module database management is part of a process that typically involves managing key databases (key3.db files) and certificate databases (cert7.db files). The key, certificate, and PKCS #11 module management process generally begins with creating the keys and key database necessary to generate and manage certificates and the certificate database.Enabling or disabling FIPS-140-1 compliance
Assigning default providers for cryptographic operations
Creating key3.db, cert7.db, and secmod.db security database files.
The modutil tool is stored in the serverRoot/shared/bin folder.
To run the modutil tool, enter the following command:
In this sytax task and [option] are a combination of a task and an option, from Table 8-3 and Table 8-4, each invocation of modutil can take one task and one option. Each option may take zero or more arguments. To view usage information, run the command without options.
You can use the modutil tool to perform a number of different tasks. These tasks are specified through the use of commands and options. Commands specify the task to perform. Options modify a task command.
Table 8-3 and Table 8-4 define the task commands and options for modutil.
The "Usage" section on page 145 section gives similar information, but by adminstrator task rather than by command.
Task Commands
Table 8-3 describes what the modutil commands do and what options are available for each. Table 8-4 defines what the options do.
Table 8-3    Task Commands and Options for modutil
Commands for Tasks
What the Command Does and Options for It
Changes the password for the named token. If the token has not been initialized, this option initializes it with the supplied password. In this context, the term "password" is equivalent to a personal identification number (PIN).
Creates new secmod.db, key3.db, and cert7.db files.
You can use the following option with this command:
If any of these security databases already exist in a specified directory, the modutil tool displays an error message.
Specifies the security mechanisms for which the named module will be a default provider.
Note: You cannot delete the Netscape internal PKCS #11 module.
Disables all slots on the named module.
Enables all slots on the named module.
Enables or disables FIPS-140-1 compliance for the Netscape internal module.
To enable compliance, enter -fips true. To disable compliance, enter -fips false.
Disables the modutil tool's interactive prompts so it can be run from a script. Use this command only after manually testing each planned operation to check for warnings and to ensure that bypassing the prompts will cause no security lapses or loss of database integrity.
Adds a new PKCS #11 module to the database. The module must be contained in the named JAR file.
The JAR file identifies all files to install, the module name, mechanism flags, and cipher flags. It should also contain any files to be installed on the target machine, including the PKCS #11 module library and other files such as documentation.
The JAR file uses the iPlanet Server PKCS #11 JAR format. See "JAR Information File" for more information on creating iPlanet JAR files.
You can use the following options with this command:
-installdir installationFolder, to specify the root installation folder for the files contained in the JAR file.
-tempdir temporaryFolder, to specify the folder in which to store temporary files created by the -jar task command
Displays basic information about the contents of the secmod.db file.
To display detailed information about a particular module including its slots and tokens, specify a value for moduleName.
Specifies the security mechanisms for which the named module will not be a default provider.
You specify the security mechanisms by using the following option:
Options
The following table describes what the options for modutil do.
Tasks that you can perform using the modutil toolare listed here in the order you might do them, with the command and any options you use to perform them. The options and arguments in square brackets are optional; those without square brackets are required.
Creating a set of security management database files (key3.db, cert7.db, and secmod.db):
Displaying basic module information or detailed information about the contents of a given module:
- -create [-dbdir dbFolder]
Adding a PKCS #11 module. This includes specifying a library file, enabling ciphers, and setting default provider status for various security mechanisms:
- -list [moduleName]
Adding a PKCS #11 module from a JAR file:
- -add moduleName -libfile libraryFile [-ciphers cipherList] [-mechanisms mechanismList]
Deleting a specific PKCS #11 module from a security module database:
- -jar JARfile -installdir installationFolder [-tempdir temporaryFolder]
Initializing or changing a token's password:
- -delete moduleName
Setting the default provider status of various security mechanisms in an existing PKCS #11 module:
- -changepw token [-pwfile passwordFile][-newpwfile newPasswordFile]
Clearing the default provider status of various security mechanisms in an existing PKCS #11 module:
- -default moduleName -mechanisms mechanismList
Enabling a specific slot or all slots within a module:
- -undefault moduleName -mechanisms mechanismList
Disabling a specific slot or all slots within a module:
- -enable moduleName [-slot slotName]
Enabling or disabling FIPS-140-1 compliance within the Netscape Communicator internal module:
- -disable moduleName [-slot slotName]
Disabling interactive prompts for the modutil tool in order to support scripted operation:
- -fips true_or_false
- -force
JAR (Java Archive) is a platform-independent file format that aggregates many files into one. JAR files are used by the modutil tool to install PKCS #11 modules. When modutil uses a JAR file, a special JAR information file must be included. This information file contains special scripting instructions and must be specified in the JAR file's MANIFEST file. Although the information file can have any name, you specify it by using the Pkcs11_install_script METAINFO command. To declare this METAINFO command in the MANIFEST file, include it in a text file that is passed to the iPlanet Signing Tool.
Sample METAINFO Tag and JAR Information File
If a PKCS #11 installer script was stored in the information file pk11install, the text file for the iPlanet Signing Tool would contain the following METAINFO tag:+ Pkcs11_install_script: pk11install
The following is an example of a JAR information file which contains instructions for installing a PKCS #11 module on different platforms. The syntax used in the file is explained in "JAR Information File Syntax."
Creating a JAR information file involves writing a script that specifies which tasks to perform when installing a module. In order to specify different module installation procedures for different platforms, you use keys, predefined commands and options that modutil interprets.
Keys are case-insensitive strings that are grouped into three categories:
Global Keys
The following sections describe the function of each of these three categories and list the keys contained in each one.
Global Keys
Global keys define the platform-specific sections of the JAR information file. There are two global keys: ForwardCompatible and Platforms.ForwardCompatible is an optional key that specifies a list of system architectures and operating systems that are compatible with later versions of the same architectures and operating systems. If the platform that modutil is installing the module on is not specified by the Platforms key, then the ForwardCompatible list is checked for any platforms that have the same OS and architecture in an earlier version. If one is found, its attributes are used for the current platform.
The ForwardCompatible key uses the following format:
ForwardCompatible { IRIX:6.2:mips SUNOS:5.5.1:sparc}
The platforms listed between the braces must have entries within the Platforms key.
Platforms is a required key that specifies a list of platforms. Each entry in the list is itself a key-value pair: the key is the name of the platform and the value list contains various attributes of the platform. The ModuleName, ModuleFile, and Files attributes must be specified for each platform unless an EquivalentPlatform attribute is specified. For more information, see "Per-Platform Keys."
The platform string is in the following format:
system name:OS release:architecture.
On non-UNIX operating systems, OS release is an empty string.
The modutil program obtains the system name, OS release, and architecture values from the system on which the modutil tool is running using low-level code written by Netscape. The following system names and platforms are currently recognized by the low-level Netscape code:
AIX (rs6000)
Here are some examples of valid platform strings:
Per-Platform Keys
These keys have meaning only within an entry in the Platforms list.ModuleName is a required key that specifies the common name for the module. This name acts as a reference to the module for Netscape Communicator, the modutil tool, servers, or any other program that uses the iPlanet security module database.
ModuleFile is a required key that names the PKCS #11 module file (DLL or .so) for this platform. The file name should be a path that is relative to the JAR file location.
DefaultMechanismFlags is an optional key that specifies mechanisms for which this module will be a default provider. This key-value pair is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR of the string constants listed in Table 8-5. If you omit the DefaultMechanismFlags entry, the value defaults to 0x0.
Table 8-5    Mechanisms That You Can Specify Using DefaultMechanismFlags
Mechanism
Hexadecimal Bitstring Value
CipherEnableFlags is an optional key that specifies ciphers that are provided by this module but not by iPlanet products. You use this key if you want to enable these ciphers for iPlanet products. The key is a bitstring specified in hexadecimal (0x) format. It is constructed as a bitwise OR of the following string constants. If you omit the CipherEnableFlags entry, the value defaults to 0x0. The only key that is provided right now is for Fortezza:
Files is a required key that lists the files that need to be installed for this module. Each entry in the file list is a key-value pair. The key includes the path to the file that is contained in the JAR archive and the value list contains the attributes of the file. At a minimum, you must specify either RelativePath or AbsolutePath for each file. If desired, you can specify additional attributes. For more information, see "Per-File Keys."
The EquivalentPlatform key specifies that the attributes of the named platform should also be used for the current platform. Using this key saves time when more than one platform uses the same settings.
Per-File Keys
These keys have meaning only within an entry in a Files list. At a minimum, RelativePath or AbsolutePath must be specified. If both are specified, the relative path is tried first, and the absolute path is used only if a relative root folder is not provided by modutil.The RelativePath key specifies the destination path of the file, relative to a folder indicated at installation. You can assign values for two variables in the relative path, "%root%" and "%temp%". At run time, "%root%" is replaced with a folder in which files should be installed, such as the server's root folder. The "%temp%" folder is created at the beginning of the installation and destroyed at the end.
The purpose of "%temp%" is to hold executable files (such as setup programs) or files that are used by these programs. For example, a Windows installation might consist of a setup.exe installation program, a help file, and a .cab file containing compressed information. All of these files could be installed in the temporary folder. Files destined for the temporary folder are in place before any executable file is launched. They are not deleted until all executable files have finished.
The AbsolutePath key specifies the destination of the file as an absolute path. If both RelativePath and AbsolutePath are specified, modutil attempts to use the relative path. If it is unable to determine a relative path, it uses the absolute path.
The Executable key specifies that a file is to be executed during the course of the installation. Typically this key is used to identify a setup program provided by a module vendor. The setup program itself is specified by the RelativePath or AbsolutePath key.
For example, to specify that the setup.exe program (located in the %temp% folder) is an executable file, you would include the following lines in your JAR information file:
Executable
RelativePath { %temp%/setup.exe }More than one file can be specified as executable, in which case the files are run in the order in which they are listed in the script file. Use the Executable key before a RelativePath or AbsolutePath key to indicate the order in which the files are to be run.
The FilePermissions key specifies the access permissions to apply to a file. The modutil program interprets the key as a string of octal digits, following the standard UNIX format. This key is a bitwise OR of the string constants listed in Table 8-6. For example, to specify Read and Execute access for all users, you would enter 555 (bitwise 400 + 100 + 040 + 010 + 004 + 001).
The following table lists the file permissions that you can specify using FilePermissions.
Table 8-6    File Permissions That You Can Specify Using FilePermissions
File Permission
Bitstring Value
Some platforms may not understand these permissions. The permissions are applied only if they make sense for the current platform. If this key is omitted, a default value of 777 (Read, Write and Execute for all users) is assumed.
This section includes examples of using modutil to perform the following tasks:
Creating Database Files
Creating Database Files
You could enter something like the following example to create a set of security management database files in a directory:modutil -create -dbdir C:\databases
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool creates the databases and displays the following:
Creating "C:\databases\key3.db"...done.
Creating "C:\databases\cert7.db"...done.
Creating "C:\databases\secmod.db"...done.
Displaying Module Information
This example uses modutil to retrieve detailed information about a specific module:modutil -list "iPlanet Internal PKCS #11 Module" -dbdir C:\databases
The modutil tool displays information similar to this:
Using database directory C:\databases...
--------------------------------------------------------
Name: Netscape Internal PKCS #11 ModuleLibrary file:
Manufacturer: Netscape Communications Corp.
Description: Communicator Internal Crypto Svc
Default Mechanism Flags: RSA:DSA:RC2:RC4:DES:SHA1:MD5:MD2
Slot: Communicator Internal Cryptographic Services Version 4.0
Manufacturer: Netscape Communications Corp
Setting a Default Provider
You could enter something like the following example to make a specific module the default provider for the RSA, DSA, and RC2 security mechanisms:modutil -default "Cryptographic Module" -dbdir C:\databases -mechanisms RSA:DSA:RC2
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool makes the change and displays the following:
Using database directory C:\databases...
Successfully changed defaults.
Enabling a Slot
You could enter something like the following example to enable a particular slot in a module:modutil -enable "Cryptographic Module" -slot "Cryptographic Reader" -dbdir C:\databases
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool enables the slot and displays the following:
Using database directory C:\databases...
Slot "Cryptographic Reader" enabled.
Enabling FIPS Compliance
You could enter something like the following example to enable FIPS-140-1 compliance in iPlanet Administration Server's internal module:Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool enables FIPS compliance and displays the following:
Adding a Cryptographic Module
You could enter something like the following example to add a new cryptographic module to the database:C:\modutil> modutil -dbdir "C:\databases" -add "Cryptorific Module" -libfile "C:\winnt\system32\crypto.dll" -mechanisms RSA:DSA:RC2:RANDOM
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool adds the module and displays the following:
Using database directory C:\databases...
Module "Cryptorific Module" added to database.
Installing a Cryptographic Module From a JAR File
You could enter something like the following example to install a cryptographic module from an installation script. The example uses this script:
To install from the script, use the following command. The root directory should be the Windows root directory (for example, C:\Windows, or C:\Winnt).
C:\modutil> modutil -dbdir "C:\databases" -jar install.jar -installdir "C:\winnt"
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool installs the module and displays the following:
Using database directory C:\databases...
This installation JAR file was signed by:
----------------------------------------------
C=US, ST=California, L=Mountain View, CN=SuperCrypto Inc., OU=Digital ID Class 3 - Netscape Object Signing, OU="www.verisign.com/repository/CPS Incorp. by Ref.,LIAB.LTD(c)9 6", OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network **ISSUER NAME**, OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign, OU=VeriSign Object Signing CA - Class 3 Organization, OU="VeriSign, Inc.", O=VeriSign Trust Network
----------------------------------------------
Do you wish to continue this installation? (y/n)
After you press y, the tool displays the following:
Using installer script "installer_script"
Successfully parsed installation script
Current platform is WINNT::x86
Using installation parameters for platform WinNT::x86
Installed file crypto.dll to C:/winnt/system32/crypto.dll
Installed file setup.exe to ./pk11inst.dir/setup.exe
Executing "./pk11inst.dir/setup.exe"...
"./pk11inst.dir/setup.exe" executed successfully
Installed module "SuperCrypto Module" into module database
Installation completed successfully
Changing the Password on a Token
You could enter something like the following example to change the password for a security device in use by a module.C:\modutil> modutil -dbdir "C:\databases" -changepw "Administration Server Certificate DB"
Before running this program, the modutil tool displays a warning:
WARNING: Performing this operation while an iPlanet product is running could cause corruption of your security databases. If an iPlanet product is currently running, you should exit the product before continuing this operation. Type 'q <enter>' to abort, or <enter> to continue:
After you press Enter, the tool changes the password and displays the following:
Using database directory C:\databases...
After you enter the old password, the tool displays the following:
After you enter the new password, the tool displays the following:
After you re-enter the new password, the tool displays the following:
Token "Administration Server Certificate DB" password changed successfully.
Previous Contents Index Documentation Resources Next
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.