What is sudo default password

mongodb

#1

I can’t restart my mongodb instante because of an error that says something about “unclean shutdown”

Then I have been searching for a solution an I came to execute this command:

sudo -u mongodb mongod --repair --dbpath /home/ubuntu/workspace/data

But a message appeared saying:

[sudo] password for ubuntu: 
Sorry, try again.

#2

there is no default sudo password. that command looks like it’d need a password for a mongodb user. normal sudo commands should work with a bank password.


#3

Hi @rodolvelasco,

I’m not C9 staff, just another user, and I don’t know an “official” answer to your query. I can offer you a good, simple workaround, though.

I don’t have a mongodb instance to do anything with, but I figure mongodb --help would be just as good for a test.

My workaround is simply to prepend a second sudo to your command:

sudo sudo -u mongodb mongod --help

This got me:

Options:

General options:
  -h [ --help ]               show this usage information
  --version                   show version information

… and so on.

The trick here is:

  • the first sudo (with no other options) turns you into user root
  • because you’re (now) running it as root, the second sudo doesn’t need a password; as root, you can become whoever you please.

Hope this helps!

-Carl-


#4

Thanks, I’ll try this.