Last active
December 25, 2015 12:19
-
-
Save huksley/6975108 to your computer and use it in GitHub Desktop.
Install mongodb latest with auth admin:123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
sudo apt-get update | |
sudo apt-get -y install mongodb-10gen | |
sudo service mongodb start | |
echo "use admin; db.addUser({ user: 'admin', pwd: '123', roles: [ 'userAdminAnyDatabase' ] });" | mongo | |
sudo service mongodb stop | |
echo "rest = true" | sudo tee /etc/mongodb.conf | |
sudo sed -re "s/\\#auth = true/auth = true/g" /etc/mongodb.conf | |
sudo service mongodb start | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment