Help Replication and Event Publishing

asnpwd: Creating and maintaining password files

Use the asnpwd command to create and change password files on Linux, UNIX, and Windows. Run this command at the command line or in a shell script.

Command help appears if you enter the asnpwd command without any parameters, followed by a ?, or followed by incorrect parameters.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-asnpwd--+-init--| Init parameters |-----+-------------------><
           +-add--| Add parameters |-------+   
           +-modify--| Modify parameters |-+   
           +-delete--| Delete parameters |-+   
           '-list--| List parameters |-----'   

Init parameters

|--+-----------------------+--+--------------------------+------|
   '-encrypt--+-all------+-'  |        .-asnpwd.aut----. |   
              '-password-'    '-using--+-filepath_name-+-'   

Add parameters

|--alias--db_alias--id--userid--password--password-------------->

>--+--------------------------+---------------------------------|
   |        .-asnpwd.aut----. |   
   '-using--+-filepath_name-+-'   

Modify parameters

|--alias--db_alias--id--userid--password--password-------------->

>--+--------------------------+---------------------------------|
   |        .-asnpwd.aut----. |   
   '-using--+-filepath_name-+-'   

Delete parameters

|--alias--db_alias--+--------------------------+----------------|
                    |        .-asnpwd.aut----. |   
                    '-using--+-filepath_name-+-'   

List parameters

|--+--------------------------+---------------------------------|
   |        .-asnpwd.aut----. |   
   '-using--+-filepath_name-+-'   

Parameters

Table 1 defines the invocation parameters for the asnpwd command.

Important note about compatibility of password files: Password files that are created by the asnpwd command starting with Version 9.5 Fix Pack 2 use a new encryption method and cannot be read by older versions of the replication programs and utilities. If you share a password file among programs and utilities that are at mixed level, with some older than these fix packs, do not recreate the password file by using an asnpwd utility that is at these fix packs or newer. Replication programs and utilities at these fix packs or newer can continue to work with older password files. Also, you cannot change an older password file to use the new encryption method; you must create a new password file.
Usage note: On 64-bit Windows operating systems, the ADD, MODIFY, DELETE, and LIST options are not supported for password files that were created by using the asnpwd command before Version 9.5 Fix Pack 2.
Table 1. asnpwd invocation parameter definitions for Linux, UNIX, and Windows operating systems
Parameter Definition
init Specify to create an empty password file. This command will fail if you specify the init parameter with a password file that already exists.
add Specify to add an entry to the password file. There can only be one entry in the password file per db_alias. This command will fail if you specify the add parameter with an entry that already exists in the password file. Use the modify parameter to change an existing entry in the password file.
modify Specify to modify the password or user ID for an entry in the password file.
delete Specify to delete an entry from the password file.
list Specify to list the aliases and user ID entries in a password file. This parameter can be used only if the password file was created by using the encrypt password parameter. Passwords are never displayed by the list command.
encrypt Specifies which entries in a file to encrypt.
all (default)
Encrypt all entries in the specified file such that you cannot list the database aliases, user names, and passwords that are in the file. This option reduces the exposure of information in password files.
password
Encrypt the password entry in the specified file. This option allows users to list the database aliases and user names stored in their password file. Passwords can never be displayed.
using filepath Specifies the path and name of the password file. Follow the file naming conventions of your operating system. An example of a valid password file on Windows is C:\sqllib\mypwd.aut.

If you specify the path and name of the password file, the path and the password file must already exist. If you are using the init parameter and you specify the path and name of the password file, the path must already exist and the command will create the password file for you.

If you do not specify this parameter, the default file name is asnpwd.aut and the default file path is the current directory.

alias db_alias Specifies the alias of the database to which the user ID has access. The alias is always folded to uppercase, regardless of how it is entered.
id userid Specifies the user ID that has access to the database.
password password Specifies the password for the specified user ID. This password is case sensitive and is encrypted in the password file.

Return Codes

The asnpwd command returns a zero return code upon successful completion. A nonzero return code is returned if the command is unsuccessful.

Examples for asnpwd

The following examples illustrate how to use the asnpwd command.

Example 1

To create a password file with the default name of asnpwd.aut in the current directory:


asnpwd INIT

Example 2

To create a password file named pass1.aut in the c:\myfiles directory:


asnpwd INIT USING c:\myfiles\pass1.aut

Example 3

To create a password file named mypwd.aut with the encrypt all parameter:


asnpwd INIT ENCRYPT ALL USING mypwd.aut

Example 4

To create a password file named mypwd.aut with the encrypt password parameter:


asnpwd INIT ENCRYPT PASSWORD USING mypwd.aut

Example 5

To create a default password file with the encrypt password parameter:


asnpwd INIT ENCRYPT PASSWORD

Example 6

To add a user ID called oneuser and its password to the password file named pass1.aut in the c:\myfiles directory and to grant this user ID access to the db1 database:


asnpwd ADD ALIAS db1 ID oneuser PASSWORD mypwd using c:\myfiles\pass1.aut

Example 7

To modify the user ID or password of an entry in the password file named pass1.aut in the c:\myfiles directory:


asnpwd MODIFY AliaS sample ID chglocalid PASSWORD chgmajorpwd 
  USING c:\myfiles\pass1.aut

Example 8

To delete the database alias called sample from the password file named pass1.aut in the c:\myfiles directory:


asnpwd delete alias sample USING c:\myfiles\pass1.aut

Example 9

To see command help:


asnpwd

Example 10

To list the entries in a default password file:


asnpwd LIST

Example 11

To list the entries in a password file named pass1.aut:

asnpwd LIST USING pass1.aut

The output from this command depends on how the password file was initialized:



Send your feedback | Information roadmap | The Q+SQL Replication Forum

Update icon Last updated: 2013-10-25