MSF_DATABASE_CONFIG to $PATH database.yml file
My database .yml file is not found by ./armitage how to fix?
it has something to do with this
I can not find database.yml. I *really* need it.
To connect to the Metasploit Framework database, Armitage needs to know the location of the database.yml file. This is normally available in the MSF_DATABASE_CONFIG environment variable.
If you installed Metasploit by hand, make sure MSF_DATABASE_CONFIG is set. You may want to try sudo -E to launch Armitage. This form of sudo will have Armitage inherit the root user's environment--including the MSF_DATABASE_CONFIG variable.
Kali Linux users, if you're getting this error--try:
service postgresql start
service metasploit start
service metasploit stop
where is MSF_DATABASE_CONFIG? i want to put it into path so i can fix this issue....
For the people that may have the same question, you can set MSF_DATABASE_CONFIG like this: export MSF_DATABASE_CONFIG=/PATH/TO/database.yml/
Then run the Armitage with sudo -E : sudo -E ./armitage ...
that would work but i think its better to reinstall it from begging again it would keep bugs him with error
Actually I faced the same issue in my cent os 7 vm box. I did find the sample database.yml file in "/opt/metasploit-framework/embedded/lib/ruby/gems/2.6.0/gems/metasploit-credential-3.0.4/spec/dummy/config/database.yml" location and it contains the following lines.
#######################################################
development: &pgsql adapter: postgresql database: metasploit-credential_development1 username: msf password: pass123 host: localhost port: 5432 pool: 5 timeout: 5 min_messages: warning test: <<: *pgsql database: metasploit-credential_test1
#############################################################
Copy above file to your home directory and make the changes such as DB user, DB password and DB name according to your requirements.
Run the following command.
export MSF_DATABASE_CONFIG=
Then run "msfd" command, it will ask you for new database setup, type yes and enter. It will create the database for you. In case if it is not prompting for new database setup, please remove ".msf4" (hidden folder) in your home directory and again run "msfd" command.
i cant find the solution again it error,after re-installing also
i've used
root@kali:/opt/metasploit-framework/bin# msfdb reinit
Creating configuration file in /usr/share/metasploit-framework/config/database.yml
and next
export MSF_DATABASE_CONFIG=/usr/share/metasploit-framework/config/database.yml