Friends I need help for initialization error of msfdb follows below error .
`aurelio@tazz:/opt/metasploit-framework/bin$ ./msfconsole
* Welcome to Metasploit Framework Initial Setup *
Please answer a few questions to get started.
Would you like to use and setup a new database (recommended)? y
/opt/metasploit-framework/embedded/framework/msfdb:128:in initialize': Permission denied @ rb_sysopen - /home/aurelio/.msf4/database.yml (Errno::EACCES)
from /opt/metasploit-framework/embedded/framework/msfdb:128:inopen'
from /opt/metasploit-framework/embedded/framework/msfdb:128:in init_db'
from /opt/metasploit-framework/embedded/framework/msfdb:232:in
* Metasploit Framework Initial Setup Complete *
touch: não foi possível tocar “/home/aurelio/.msf4/initial_setup_complete”: Permissão negada
Rails Error: Unable to access log file. Please ensure that /home/aurelio/.msf4/logs/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
/opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:in initialize': Permission denied @ rb_sysopen - /home/aurelio/.msf4/logs/framework.log (Errno::EACCES)
from /opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:innew'
from /opt/metasploit-framework/embedded/framework/lib/rex/logging/sinks/flatfile.rb:21:in initialize'
from /opt/metasploit-framework/embedded/framework/lib/msf/base/logging.rb:24:innew'
from /opt/metasploit-framework/embedded/framework/lib/msf/base/logging.rb:24:in init'
from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework.rb:111:insimplify'
from /opt/metasploit-framework/embedded/framework/lib/msf/base/simple/framework.rb:73:in create'
from /opt/metasploit-framework/embedded/framework/lib/msf/ui/console/driver.rb:65:ininitialize'
from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:in new'
from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:62:indriver'
from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/console.rb:48:in start'
from /opt/metasploit-framework/embedded/framework/lib/metasploit/framework/command/base.rb:82:instart'
from /opt/metasploit-framework/bin/../embedded/framework/msfconsole:48:in <main>'
aurelio@tazz:/opt/metasploit-framework/bin$
Hi! Really sorry for the delay in responding. It looks like you are using the omnibus installer. Is that the case? What operating system are you using?
You might be able to get past this by manually creating the directory it complains about, e.g.:
mkdir -p ~/.msf4/logs/
This is because your .msf4/database.yml file is inadvertently owned by a user that is not you. Possibly because you may have initially run metasploit as root initially.
Try chown -R `whoami` ~/.msf4
Thanks!
@bcook-r7 worked for me thanks man.
Isso ocorre porque o arquivo .msf4 / database.yml pertence inadvertidamente a um usuário que não é você. Possivelmente porque você pode ter executado inicialmente o metasploit como root inicialmente.
Experimentar
chown -R `whoami` ~/.msf4Obrigado!
Vlw ajudou
Most helpful comment
This is because your .msf4/database.yml file is inadvertently owned by a user that is not you. Possibly because you may have initially run metasploit as root initially.
Try
chown -R `whoami` ~/.msf4Thanks!