Create user account in snorby via CLI

452 views
Skip to first unread message

Mark Chennell

unread,
Jan 5, 2015, 8:13:12 AM1/5/15
to securit...@googlegroups.com
I need to create a new user account for snorby, as we initially build the box 6 months back to test and eval and now we have come to log back into the snorby interface and cannot.

Icannot login with any of the user accounts,

When i try the reset password procedure https://code.google.com/p/security-onion/wiki/Passwords it does not find any other user accounts:

snort@ukocsnorbyman:/opt/snorby$ sudo RAILS_ENV=production bundle exec rails c
[sudo] password for snort:
Jammit Warning: Asset compression disabled -- Java unavailable.
Loading production environment (Rails 3.1.10)
irb(main):001:0> u = User.find_by_email("mchennell@XXXXX")
=> nil


Is it possible to create a new user account or someone else have any other ideas?

Many thanks

Mark


Dustin Webber

unread,
Jan 5, 2015, 8:36:26 AM1/5/15
to securit...@googlegroups.com
RAILS_ENV=production rails -e `User.create(:name => 'Administrator', :email => 'sno...@snorby.org', :password => 'snorby', :password_confirmation => 'snorby', :admin => true)`

Dustin Willis Webber


Mark


--
You received this message because you are subscribed to the Google Groups "security-onion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onio...@googlegroups.com.
To post to this group, send email to securit...@googlegroups.com.
Visit this group at http://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.

Mark Chennell

unread,
Jan 5, 2015, 9:09:27 AM1/5/15
to securit...@googlegroups.com
Hi thanks for the reply, but i dont think it took, please see below


snort@ukocsnorbyman:/opt/snorby$ sudo RAILS_ENV=production bundle exec rails c [sudo] password for snort:
Jammit Warning: Asset compression disabled -- Java unavailable.
Loading production environment (Rails 3.1.10)
irb(main):001:0> RAILS_ENV=production rails -e `User.create(:name => 'Administrator', :email => 'sno...@snorby.org', :password => 'snorby', :password_confirmation => 'snorby', :admin => true)`
SyntaxError: (irb):1: syntax error, unexpected tXSTRING_BEG, expecting keyword_do or '{' or '('
...RAILS_ENV=production rails -e `User.create(:name => 'Adminis...
... ^
from /opt/snorby/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands/console.rb:45:in `start'
from /opt/snorby/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands/console.rb:8:in `start'
from /opt/snorby/vendor/bundle/ruby/1.9.1/gems/railties-3.1.10/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):002:0>

Mark Chennell

unread,
Jan 5, 2015, 11:24:51 AM1/5/15
to securit...@googlegroups.com
ah got it working, cheers Dustin

Daniel

unread,
Jul 10, 2015, 3:41:35 PM7/10/15
to securit...@googlegroups.com

I know this is an older post, but it helped me and I had some things to add that I changed.

Background: I'm writing a BASH script to add an account in every tool for a new analyst.

My BASH test lines with info hard-coded:
cd /opt/snorby/
sudo RAILS_ENV=production bundle exec rails runner 'User.create(:name => "Test", :email => "te...@test.com", :password => "password", :password_confirmation => "password", :admin => true)'

My BASH script lines with variables:
cd /opt/snorby/
RAILS_ENV=production bundle exec rails runner 'User.create(:name => "'"$userDisplay"'", :email => "'"$userName@$userDomain"'", :password => "'"$userPass"'", :password_confirmation => "'"$userPass"'", :admin => false)'
cd ~

Reply all
Reply to author
Forward
0 new messages