How to set a MSF_DATABASE_CONFIG variable

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
lhopkins2
Level 1
Level 1
Posts: 8
Joined: Tue Dec 05, 2017 9:49 pm

How to set a MSF_DATABASE_CONFIG variable

Post by lhopkins2 » Tue Dec 05, 2017 9:56 pm

In the process of installing armitage on Linux Mint 18.2 I am stuck on an error message. I run ./armitage through root user I need to set a MSF_DATABASE_CONFIG environment variable that stores a database.yml file. How can I set this variable and route it to the database.yml file?

User avatar
WharfRat
Level 20
Level 20
Posts: 11139
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by WharfRat » Tue Dec 05, 2017 10:48 pm

Hello lhopkins2 Image

Welcome to Linux Mint and the Linux Mint forum :)

In the terminal enter MSF_DATABASE_CONFIG=whatever_it_needs_to_be

To check it echo $MSF_DATABASE_CONFIG

Example

Code: Select all

[bill@XPS] ~ $ MSF_DATABASE_CONFIG=whatever_it_needs_to_be
[bill@XPS] ~ $ echo $MSF_DATABASE_CONFIG
whatever_it_needs_to_be
[bill@XPS] ~ $ 
Good luck :wink:
Image ImageImage

lhopkins2
Level 1
Level 1
Posts: 8
Joined: Tue Dec 05, 2017 9:49 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by lhopkins2 » Thu Dec 07, 2017 12:13 am

Thanks for the reply!
I tried this, when I run MSF_DATABASE_CONFIG=database.yml or /home/liamh/.msf4/db or /home/liamh/.msf4/db/database.yml it will work and when echoed it appears correctly. When in another terminal, this variable does not appear I believe this is because I need to set it as an environment variable. How can I do this?
The exact error message is: "I cannot find a database.yml file. I *really* need it.
Here's how to fix this:
1. Try setting MSF_DATABSE_CONFIG to a file that exists.
2. Did you use sudo to start the program? Try sudo -E."
I have tried starting it with, and without sudo and sudo -E no difference.
Edit: when I said "it will work" the program still wouldn't run (same error message) I was referring to the echo having the correct output.
Last edited by lhopkins2 on Thu Dec 07, 2017 1:01 am, edited 1 time in total.

User avatar
WharfRat
Level 20
Level 20
Posts: 11139
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by WharfRat » Thu Dec 07, 2017 1:06 am

If you don't have a ~/.bashrc, create it and add export MSF_DATABASE_CONFIG=whatever_it_needs_to_be or if you already have one just add that line.
Image ImageImage

lhopkins2
Level 1
Level 1
Posts: 8
Joined: Tue Dec 05, 2017 9:49 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by lhopkins2 » Thu Dec 07, 2017 5:43 pm

What do you mean by create a .bashrc there is one stored in /ect that I can locate named bash.bashrc
If I run "locate .bashrc" I get
/etc/bash.bashrc
/etc/skel/.bashrc
/root/.bashrc
/usr/share/base-files/dot.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/bash.bashrc
/usr/share/doc/adduser/examples/adduser.local.conf.examples/skel/dot.bashrc


Thanks for the Help! :D

User avatar
WharfRat
Level 20
Level 20
Posts: 11139
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by WharfRat » Thu Dec 07, 2017 5:58 pm

Copy /etc/skel/.bashrc to your home and add the export MSF_DATABASE_CONFIG line.
Image ImageImage

lhopkins2
Level 1
Level 1
Posts: 8
Joined: Tue Dec 05, 2017 9:49 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by lhopkins2 » Fri Dec 08, 2017 12:09 am

Ugh. even though "locate" tells me where ./bashrc is, etc/skel/ is empty if I use "~/.bashrc" in terminal it says permission denied despite me using sudo, or sudo su. Now my terminal is also suddenly black and white. Other forums say this is due to .bashrc.

User avatar
WharfRat
Level 20
Level 20
Posts: 11139
Joined: Thu Apr 07, 2011 8:15 pm

Re: How to set a MSF_DATABASE_CONFIG variable

Post by WharfRat » Fri Dec 08, 2017 12:54 am

Escalated privileges is not necessary to copy /etc/skel/.bashrc :?

Just make sure you're in your home with cd ~ then cp /etc/skel/.bashrc . then source .bashrc
Image ImageImage

Post Reply

Return to “Newbie Questions”