The dbpassword command
You can use the dbpassword command to store passwords to Db2® systems in an encrypted keystore in a local client machine. You can use the CLI commands without having to type your password on the command line.
The following tools support reading passwords from the keystore:
- dbsql
- dbload
- db_migrate
- db_migrate_iias
Syntax
The dbpassword command uses the following
syntax:
dbpassword subcommand [subcommand option]
Options
- -h, --help, -?
- Displays help for the command.
- -[rR]ev, -V
- Displays the software revision level.
- -hc
- Displays help for the subcommands.
Subcommands
- show
- Shows the currently cached passwords. Set by default.
- add
- Adds a locally cached password.
- delete
- Removes the locally cached passwords.
- resetkey
- Resets the client key.
- update
- Updates a key for a particular user or host.
Subcommand options
The dbpassword command uses the following options:
dbpassword -host name|IP -u user name -pw password -timeout seconds -skipConnCheck
Subcommand | Option | Description |
---|---|---|
dbpassword add | -host name|IP | Specifies a hostname or an IP address. [DB_HOST] |
-u user name | Specifies the user name. [DB_USER] | |
-pw password | Specifies the user password. [DB_PASSWORD] | |
-timeout seconds | Specifies how long to wait for the command to time out before returning an error. The value is provided in seconds. The default is 300 seconds. | |
-skipConnCheck TRUE|FALSE | The option to skip host, user and password validation. The default is TRUE. | |
dbpassword delete | -host name|IP | Specifies a hostname or an IP address. [DB_HOST] |
-u user name | Specifies a username. | |
-all | Deletes all cached passwords. | |
dbpassword update | -host name|IP | Specifies a hostname or an IP address. [DB_HOST] |
-u user name | Specifies the user name. [DB_USER] | |
-pw password | Specifies the user password. [DB_PASSWORD] | |
-timeout seconds | Specifies how long to wait for the command to time out before returning an error. The value is provided in seconds. The default is 300 seconds. | |
-skipConnCheck TRUE|FALSE | The option to skip host, user and password validation. The default is TRUE. | |
dbpassword resetkey | -none | Resets client key to nothing |
Description
The dbpassword command does the following:
- Privileges required
- You must be logged in as a
db
user or any valid Linux account for the Performance Server system. - Common tasks
- Use the
dbpassword
command to store a local version of your password.
Related commands
You can use dbpassword with the create user
and alter
user
commands.
Examples
The following provides sample usage:
- To add a password, enter:
dbpassword add -host dbhost -u user -pw password
- To delete a password, enter:
dbpassword delete -host dbhost -u user
- To display cached passwords, enter:
dbpassword show
- To reset the client key to nothing, enter:
dbpassword resetkey -none