To use the remote data service you will need a PostgreSQL database running to serve as the backend. You can find more information on setting that up on the
You can use the `db_connect` command to connect to the desired data service. Please note that you can only be connected to one data service at a time. The `db_disconnect` command will need to be used before switching to a new data service. You can use `db_status` to see information about the currently connected data service.
**Usage:**
*`db_connect <options> <url>`
* Options:
*`-l`,`--list-services` - List the available data services that have been previously saved.")
*`-n`,`--name` - Connect to a previously saved data service by specifying the name.")
*`-c`,`--cert` - Certificate file matching the remote data server's certificate. Needed when using self-signed SSL cert.
*`-t`,`--token` - The API token used to authenticate to the remote data service.
*`--skip-verify` - Skip validating authenticity of server's certificate. NOT RECOMMENDED.
* Examples:
*`db_connect http://localhost:8080` - Connect to the Metasploit REST API instance at localhost running on port 8080
*`db_connect -c ~/.msf4/msf-ws-cert.pem -t 72ce00fd9ab1a96970137e5a12faa12f38dcc4a9e42158bdd3ce7043c65f5ca37b862f3faf3630d2 https://localhost:8080` - Connect to the server running at localhost on port 8080 that has SSL and authentication enabled.
*`db_connect -l` - List the data services that have been saved using the `db_save` command.
*`db_connect -n LA_server` - Connect to the data service named "LA_server" that has been previously saved using `db_save`.
The currently connected data service can be saved for later use using the `db_save` command. The `default` connection is the data service that msfconsole will connect to on startup.
There are a few pieces of information to keep in mind when using data services with Metasploit Framework.
* A Postgres database connection is required before connecting to a remote data service.
* The configuration from the `database.yml` will still be honored for the foreseeable future, but a saved default data service will take priority when it is present.