Skip to content

Instantly share code, notes, and snippets.

@sarjarapu
Created October 5, 2018 04:46
Show Gist options
  • Save sarjarapu/7fc39c6c86b9dc26394f897cf196e3d4 to your computer and use it in GitHub Desktop.
Save sarjarapu/7fc39c6c86b9dc26394f897cf196e3d4 to your computer and use it in GitHub Desktop.
A bash script to configure environment variables and set permissions for the folders
sudo klist -k /var/lib/mongo/private/mon01.keytab
# Keytab name: FILE:/var/lib/mongo/private/mon01.keytab
# KVNO Principal
# ---- ------------------------------------------
# 2 mongodb/[email protected]
# Set the keytab file location in environment variable
echo "KRB5_KTNAME=/var/lib/mongo/private/mon01.keytab" | sudo tee /etc/sysconfig/mongod
# Change the folder ownership to mongod
sudo chown -R mongod:mongod /var/lib/mongo/private
sudo systemctl start mongod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment