I'm facing a problem with my Zsh terminal, i'm trying to deploy a MongoDB local Replica Set for testing. I can't create a keyfile, even if i use sudo
command, can't use chown
, chmod
or openssl rand -base64
. I will attach photos. Even my config file of mongod.Config File and ZSH TERMINAL
/usr/local/etc/mongod.conf
storage:
dbPath: /usr/local/var/mongodb/node1
net:
port:27011
security:
authorization: enabled
keyFile: /var/mongodb/pki/rtype-keyfile
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: rtypeSet
Im following these steps to create a keyfile
sudo mkdir -p /var/mongodb/pki/
sudo chown $USER:$USER /var/mongodb/pki/
openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile
chmod 400 /var/mongodb/pki/rtype-keyfile
Actual zsh terminal execution showing errors:
Last login: Wed May 3 17:48:42 on ttys000
^C
[Heidis-MacBook-Pro% sudo mkdir -p /var/mongodb/pki/
[Password:
[Heidis-MacBook-Pro% sudo chown $redacted $redacted /var/mongodb/pki/
[Heidis-MacBook-Pro% openssl rand -base64 756 > /var/mongodb/pki/rtype-keyfile
zsh: permission denied: /var/mongodb/pki/rtype-keyfile
[Heidis-MacBook-Pro% chmod 400 /var/mongodb/pki/rtype-keyfile
chmod: /var/mongodb/pki/rtype-keyfile: No such file or directory
Heidis-MacBook-Pro%
As you can see when creating the folder it does not return any results, don't create any file, just give me permission denied
i already follow these steps and still not working (here below) https://iboysoft.com/howto/fix-zsh-permission-denied-in-mac-terminal.html
Thank you for your help! I have been dealing with this problem since 4 days:(
I hope to find a way, to solve this permission denied problem, pd: I have not installed Oh my Zsh.