@@ -138,48 +138,25 @@ On Linux systems, simply having docker-cli is sufficient.
138
138
139
139
** Note** : Depending on your environment, these commands might require ` sudo `
140
140
141
- * Pull the Docker container: ` docker pull postgres:14 `
142
- * Start the container:
141
+ * Start the postgres container:
143
142
144
143
``` bash
145
- docker run --rm -p 127.0.0.1:5432:5432 -e POSTGRESS_PASSWORD=" mysecretpassword" postgres:14
146
- ```
147
-
148
- Wait till the container is fully running.
149
- We need to make some changes in the container to be able to connect to it remotely using the ` psql ` client.
150
-
151
- * Open a shell to the running container: ` docker exec -it "postgres" bash `
152
- * Install an editor: ` sudo apt update && sudo apt install -y nano `
153
- * Edit ` /var/lib/postgresql/data/postgresql.conf ` and uncomment: ` # password_encryption = scram-sha-256 # scram-sha-256 or md5 `
154
- * Exit the shell on the container
155
- * Ensure the postgres client is installed on your host system
156
- * connect to the running container (the password is ` mysecretpassword ` ): ` psql -h 127.0.0.1 -U postgres `
157
-
158
- After this you should be able to connect with the ` postgres ` user using the password from the commands.
159
- We highly recommend to use the same credentials and use the ` database.yml ` below as example.
160
- With this approach you do not require the ` ./msfdb init ` command. The standard Rails commands for creating
161
- the database are sufficient: ` bundle exec rails db:create db:migrate db:seed `
162
-
163
- ### database.yml
164
-
165
- ``` yaml
166
- development : &defaults
167
- adapter : postgresql
168
- database : metasploit_pro_development
169
- username : postgres
170
- password : mysecretpassword
171
- host : 127.0.0.1
172
- port : 5432
173
- pool : 200
174
- timeout : 5
175
-
176
- production :
177
- << : *defaults
178
- database : metasploit_pro_production
179
-
180
- test :
181
- << : *defaults
182
- database : metasploit_pro_test
144
+ docker run --rm -it -p 127.0.0.1:5433:5432 -e POSTGRES_PASSWORD=" mysecretpassword" postgres:14
145
+ ```
146
+
147
+ Wait till the postgres container is fully running.
148
+
149
+ * Configure the Metasploit database:
150
+
151
+ ```
152
+ cd ~/git/metasploit-framework
153
+ ./msfdb init --connection-string="postgres://postgres:[email protected] :5433/postgres"
154
+ ```
155
+
156
+ * If the ` msfdb init ` command succeeds, then confirm that the database is accessible to Metasploit:
157
+
158
+ ``` bash
159
+ $ ./msfconsole -qx " db_status; exit"
183
160
```
184
161
185
162
### Manual Installation
0 commit comments