M103 Keyfile Permission denied

I do not understand why am getting permission denied here when I tried running OpenSSL, please I need help here.
This is what am currently working on.
image

This is my work and the error msg, I tried to give vagrant access but is still showing the same thing.
image

Let’s see the output of:
ls -l /var/mongodb/pki/
ls -l /var/mongodb

@007_jb

Try:
ls -l /var/mongodb/pki
sudo ls -l /var/mongodb/pki

@007_jb

@Onyeka_16206 copy this entire block and execute it:

sudo rm -r /var/mongodb
sudo mkdir -p /var/mongodb/pki/
sudo chown vagrant:vagrant /var/mongodb/pki/
openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile
chmod 400 /var/mongodb/pki/m103-keyfile
ls -l /var/mongodb/pki
ls -l /var/mongodb

and show us the result.

@007_jb

Looks like you tried making a change there :wink:

I think you’re in business and ready to go! Finally test this:
cat /var/mongodb/m103-keyfile

@007_jb

Copy and paste, don’t type it in. You’ll make mistakes if you keep typing it in. :+1:

If you’re not sure how to paste, just right click inside the shell and it will paste where the cursor is blinking.

@007_jb Even after pasting it , am still getting same msg.

My mistake with the path. Try:
cat /var/mongodb/pki/m103-keyfile

@007_jb this is what have now…

That’s it. You’re good to go!

@007_jb Ok thanks… but this is currently what I have right now,

But below is what am suppose to work within my Lab,

Can I remove what I have right now and start with that of my LAB or should I continue with what I have on the ground…

Thanks

What I gave you is essentially the same as what the lab does. The only difference is chmod 400 vs chmod 600.
400 is sufficient for the lab so carry on from here. It will cause no harm if you run the 600 line but don’t run any other lines.

@007_jb , ok thanks but I am still on the same trend though different issue now.

Trying to start my first MongoD process.

That’s a different problem altogether. Suggest you create a new thread.

@007_jb Ok, thanks, let me do that